Documentation ¶
Overview ¶
Package kms contains KMS and KMS MRK Master Key implementations.
Index ¶
- Variables
- type KeyFactory
- type KeyHandler
- type MasterKey
- func (kmsMK *MasterKey) DecryptDataKey(ctx context.Context, encryptedDataKey model.EncryptedDataKeyI, ...) (model.DataKeyI, error)
- func (kmsMK *MasterKey) EncryptDataKey(ctx context.Context, dataKey model.DataKeyI, alg *suite.AlgorithmSuite, ...) (model.EncryptedDataKeyI, error)
- func (kmsMK *MasterKey) GenerateDataKey(ctx context.Context, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (model.DataKeyI, error)
- type MrkKeyFactory
- type MrkMasterKey
Constants ¶
This section is empty.
Variables ¶
var ErrKmsClient = errors.New("KMSClient error")
ErrKmsClient is returned when AWS KMS encounters an error.
Functions ¶
This section is empty.
Types ¶
type KeyFactory ¶
type KeyFactory struct{}
KeyFactory is a factory for creating Kms MasterKey.
func (*KeyFactory) NewMasterKey ¶
func (f *KeyFactory) NewMasterKey(args ...interface{}) (model.MasterKey, error)
NewMasterKey factory method returns a new instance of Kms MasterKey.
type KeyHandler ¶
KeyHandler is an interface specific to the Kms MasterKey which is used by the KmsMasterKeyProvider.
type MasterKey ¶
MasterKey contains the Kms Master Key, KMS Client, and it implements the model.MasterKey interface.
func (*MasterKey) DecryptDataKey ¶
func (kmsMK *MasterKey) DecryptDataKey(ctx context.Context, encryptedDataKey model.EncryptedDataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (model.DataKeyI, error)
DecryptDataKey decrypts the encrypted data key and returns the data key.
func (*MasterKey) EncryptDataKey ¶
func (kmsMK *MasterKey) EncryptDataKey(ctx context.Context, dataKey model.DataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (model.EncryptedDataKeyI, error)
EncryptDataKey encrypts the data key and returns the encrypted data key.
func (*MasterKey) GenerateDataKey ¶
func (kmsMK *MasterKey) GenerateDataKey(ctx context.Context, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (model.DataKeyI, error)
GenerateDataKey generates a new data key and returns it.
type MrkKeyFactory ¶
type MrkKeyFactory struct{}
MrkKeyFactory is a factory for creating Kms MrkMasterKey.
func (*MrkKeyFactory) NewMasterKey ¶
func (f *MrkKeyFactory) NewMasterKey(args ...interface{}) (model.MasterKey, error)
NewMasterKey factory method returns a new instance of Kms MrkMasterKey.
type MrkMasterKey ¶
type MrkMasterKey struct {
MasterKey
}
MrkMasterKey is a Kms MasterKey that uses a KMS multi-Region key. It embeds the Kms MasterKey and implements the Kms KeyHandler interface.
func (*MrkMasterKey) DecryptDataKey ¶
func (kmsMrkMK *MrkMasterKey) DecryptDataKey(ctx context.Context, encryptedDataKey model.EncryptedDataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (model.DataKeyI, error)
DecryptDataKey decrypts the encrypted data key and returns the data key.
func (*MrkMasterKey) OwnsDataKey ¶
func (kmsMrkMK *MrkMasterKey) OwnsDataKey(key model.Key) bool
OwnsDataKey checks if the key resource ARN matches the keyID of the master key. Both ARNs must be MRK ARNs.