Documentation
¶
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 ¶
View Source
var (
ErrKmsClient = errors.New("KMSClient error")
)
Functions ¶
This section is empty.
Types ¶
type KeyFactory ¶
type KeyFactory struct{}
func (*KeyFactory) NewMasterKey ¶
func (f *KeyFactory) NewMasterKey(args ...interface{}) (model.MasterKey, error)
type KeyHandler ¶
type MasterKey ¶
func NewKmsMasterKey ¶
func (*MasterKey) DecryptDataKey ¶
func (kmsMK *MasterKey) DecryptDataKey(ctx context.Context, encryptedDataKey model.EncryptedDataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (model.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 (*MasterKey) EncryptDataKey ¶
func (kmsMK *MasterKey) EncryptDataKey(ctx context.Context, dataKey model.DataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (model.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 (*MasterKey) GenerateDataKey ¶
func (kmsMK *MasterKey) GenerateDataKey(ctx context.Context, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (model.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
type MrkKeyFactory ¶
type MrkKeyFactory struct{}
func (*MrkKeyFactory) NewMasterKey ¶
func (f *MrkKeyFactory) NewMasterKey(args ...interface{}) (model.MasterKey, error)
type MrkMasterKey ¶
type MrkMasterKey struct {
MasterKey
}
func NewKmsMrkMasterKey ¶
func NewKmsMrkMasterKey(client model.KMSClient, keyID string) (*MrkMasterKey, error)
func (*MrkMasterKey) DecryptDataKey ¶
func (kmsMrkMK *MrkMasterKey) DecryptDataKey(ctx context.Context, encryptedDataKey model.EncryptedDataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (model.DataKeyI, error)
func (*MrkMasterKey) OwnsDataKey ¶
func (kmsMrkMK *MrkMasterKey) OwnsDataKey(key model.Key) bool
Click to show internal directories.
Click to hide internal directories.