Documentation
¶
Overview ¶
Package encryption provides encryption and decryption functionality using AWS KMS.
Index ¶
Constants ¶
const KMSKeySizeInBytes int32 = 64
KMSKeySizeInBytes is the key size that is fetched from KMS. 64 bytes key is split into two halves. First half 32 bytes key is used by agent for encryption and second half 32 bytes by clients like cli/console.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Encrypter ¶
Encrypter implements the IEncrypter interface using AWS KMS for key management.
func NewEncrypter ¶
func NewEncrypter(ctx context.Context, logger log.T, kmsKeyID string, encryptionContext Context, kmsService *kms.Client) (*Encrypter, error)
NewEncrypter creates a new Encrypter instance with the given KMS key and encryption context.
func (*Encrypter) GetEncryptedDataKey ¶
GetEncryptedDataKey returns the cipherText that was pulled from KMS.
func (*Encrypter) GetKMSKeyID ¶
GetKMSKeyID gets the KMS key id that is used to generate the encryption key.
type IEncrypter ¶
type IEncrypter interface {
Encrypt(plainText []byte) (cipherText []byte, err error)
Decrypt(cipherText []byte) (plainText []byte, err error)
GetEncryptedDataKey() (ciptherTextBlob []byte)
}
IEncrypter defines the interface for encryption and decryption operations.
type KMSKeyProvider ¶
type KMSKeyProvider interface {
GenerateDataKey()
}
KMSKeyProvider defines the interface for AWS KMS key operations.