Documentation
¶
Index ¶
- Variables
- type DataKey
- type DataKeyI
- type EncryptedDataKey
- type EncryptedDataKeyI
- type Key
- type KeyBase
- type KeyEntry
- type KeyMeta
- type KmsMasterKey
- func (kmsMK *KmsMasterKey) DecryptDataKey(ctx context.Context, encryptedDataKey EncryptedDataKeyI, ...) (DataKeyI, error)
- func (kmsMK *KmsMasterKey) EncryptDataKey(ctx context.Context, dataKey DataKeyI, _ *suite.AlgorithmSuite, ...) (EncryptedDataKeyI, error)
- func (kmsMK *KmsMasterKey) GenerateDataKey(ctx context.Context, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
- func (kmsMK *KmsMasterKey) KeyID() string
- func (kmsMK *KmsMasterKey) Metadata() KeyMeta
- func (kmsMK *KmsMasterKey) OwnsDataKey(key Key) bool
- type KmsMasterKeyI
- type MasterKeyBase
- type RawMasterKey
- func (rawMK *RawMasterKey) DecryptDataKey(_ context.Context, encryptedDataKey EncryptedDataKeyI, ...) (DataKeyI, error)
- func (rawMK *RawMasterKey) EncryptDataKey(_ context.Context, dk DataKeyI, alg *suite.AlgorithmSuite, ...) (EncryptedDataKeyI, error)
- func (rawMK *RawMasterKey) GenerateDataKey(_ context.Context, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
- func (rawMK *RawMasterKey) KeyID() string
- func (rawMK *RawMasterKey) Metadata() KeyMeta
- func (rawMK *RawMasterKey) OwnsDataKey(key Key) bool
- type RawMasterKeyI
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type DataKey ¶
type DataKey struct {
// contains filtered or unexported fields
}
func (DataKey) EncryptedDataKey ¶
func (DataKey) KeyProvider ¶
type EncryptedDataKey ¶
type EncryptedDataKey struct {
// contains filtered or unexported fields
}
func NewEncryptedDataKey ¶
func NewEncryptedDataKey(provider KeyMeta, encryptedDataKey []byte) *EncryptedDataKey
func (EncryptedDataKey) EncryptedDataKey ¶
func (edk EncryptedDataKey) EncryptedDataKey() []byte
func (EncryptedDataKey) KeyID ¶
func (edk EncryptedDataKey) KeyID() string
func (EncryptedDataKey) KeyProvider ¶
func (edk EncryptedDataKey) KeyProvider() KeyMeta
type EncryptedDataKeyI ¶
type KeyEntry ¶
type KeyEntry[V any] struct { Entry V }
func NewKeyEntry ¶
func NewKeyEntry[V MasterKeyBase](key V) KeyEntry[V]
func NewKeyEntryPtr ¶
func NewKeyEntryPtr[V MasterKeyBase](key V) *KeyEntry[V]
type KeyMeta ¶
func WithKeyMeta ¶
type KmsMasterKey ¶
type KmsMasterKey struct {
// contains filtered or unexported fields
}
func NewKmsMasterKey ¶
func NewKmsMasterKey(client *kms.Client, keyID string) (*KmsMasterKey, error)
func (*KmsMasterKey) DecryptDataKey ¶
func (kmsMK *KmsMasterKey) DecryptDataKey(ctx context.Context, encryptedDataKey EncryptedDataKeyI, _ *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
DecryptDataKey returns DataKey which is decrypted from EncryptedDataKey that was encrypted by EncryptDataKey DataKey contains:
provider keyID of this (MasterKey) KmsMasterKey MUST equals to EncryptedDataKey keyID dataKey Plaintext is decrypted content of EncryptedDataKey encryptedDataKey encryptedDataKey encrypted content of (this) EncryptedDataKey
Decrypted dataKey (plaintext) MUST match DataKey (plaintext) that was originally generated at GenerateDataKey.
func (*KmsMasterKey) EncryptDataKey ¶
func (kmsMK *KmsMasterKey) EncryptDataKey(ctx context.Context, dataKey DataKeyI, _ *suite.AlgorithmSuite, ec suite.EncryptionContext) (EncryptedDataKeyI, error)
EncryptDataKey returns EncryptedDataKey which is encrypted from DataKey that was generated at GenerateDataKey EncryptedDataKey contains:
provider keyID of this (MasterKey) KmsMasterKey encryptedDataKey CiphertextBlob is encrypted content of dataKey (this or other) i.e. GenerateDataKey (encryption material generator), once per primaryMasterKey -> -> for each MasterKey (KmsMasterKey) registered in providers.MasterKeyProvider do EncryptDataKey
func (*KmsMasterKey) GenerateDataKey ¶
func (kmsMK *KmsMasterKey) GenerateDataKey(ctx context.Context, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
GenerateDataKey returns DataKey is generated from primaryMasterKey in MasterKeyProvider DataKey contains:
provider keyID of this (MasterKey) KmsMasterKey dataKey Plaintext of this generated dataKey encryptedDataKey CiphertextBlob of this generated dataKey
func (*KmsMasterKey) KeyID ¶
func (kmsMK *KmsMasterKey) KeyID() string
func (*KmsMasterKey) Metadata ¶
func (kmsMK *KmsMasterKey) Metadata() KeyMeta
func (*KmsMasterKey) OwnsDataKey ¶
func (kmsMK *KmsMasterKey) OwnsDataKey(key Key) bool
type KmsMasterKeyI ¶
type KmsMasterKeyI interface {
MasterKeyBase
// contains filtered or unexported methods
}
type MasterKeyBase ¶
type MasterKeyBase interface {
KeyID() string
Metadata() KeyMeta
OwnsDataKey(key Key) bool
GenerateDataKey(ctx context.Context, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
EncryptDataKey(ctx context.Context, dataKey DataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (EncryptedDataKeyI, error)
DecryptDataKey(ctx context.Context, encryptedDataKey EncryptedDataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
}
type RawMasterKey ¶
type RawMasterKey struct {
Encrypter encryption.GcmBase
// contains filtered or unexported fields
}
func NewRawMasterKey ¶
func NewRawMasterKey(providerID, keyID string, rawKey []byte) (*RawMasterKey, error)
func (*RawMasterKey) DecryptDataKey ¶
func (rawMK *RawMasterKey) DecryptDataKey(_ context.Context, encryptedDataKey EncryptedDataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
func (*RawMasterKey) EncryptDataKey ¶
func (rawMK *RawMasterKey) EncryptDataKey(_ context.Context, dk DataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (EncryptedDataKeyI, error)
func (*RawMasterKey) GenerateDataKey ¶
func (rawMK *RawMasterKey) GenerateDataKey(_ context.Context, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
func (*RawMasterKey) KeyID ¶
func (rawMK *RawMasterKey) KeyID() string
func (*RawMasterKey) Metadata ¶
func (rawMK *RawMasterKey) Metadata() KeyMeta
func (*RawMasterKey) OwnsDataKey ¶
func (rawMK *RawMasterKey) OwnsDataKey(key Key) bool
type RawMasterKeyI ¶
type RawMasterKeyI interface {
MasterKeyBase
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.