Crypto Key

Crypto Key describes a key that can be used cryptographic operations such as encryption, decryption or generating digital signatures. Managing access to sensitive data through keys is the platform-agnostic building block for compliance-encumbered systems.

type CryptoKey struct {
    KeySpec *KeySpec `json:"key_spec,omitempty"`
    DataKey *DataKey `json:"data_key,omitempty"`
}

type DataKey struct {
    KeyID          *string `json:"key_id"`
    Algorithm      *string `json:"key_algo"`
    Plaintext      []byte `sensitive:"true"`
    CiphertextBlob []byte
}

type KeySpec struct {
    // Example = arn:aws:kms:us-west-2:436578702069:key/f5208fa1-13f1-4d9c-90e8-802609342d07
    Selector string `json:"selector"`
    // Example = low
    SensivityLevel string `json:"sensitivity_level"
}
import (
    "reflect"
    "github.com/ume/api/pkg/mirror"
)

func HandleSensitiveData(form *Form) {
    ckey := mirror.CryptoKey{
        KeySpec: mirror.KeySpec{
            SensitivityLevel: "low",
        },
    }

    ckey.Expand()

    // Do something with ckey.DataKey.Plaintext
}