Documentation
¶
Overview ¶
Package esdk implements the AWS Encryption SDK message format for KMS-wrapped data keys.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidDataKey = errors.New("esdk: data key must be 32 bytes")
ErrInvalidDataKey is returned when the data key is not an AES-256 key.
var ErrMalformed = errors.New("esdk: malformed message")
ErrMalformed is returned for a message that does not parse or authenticate as a v2 committed message.
Functions ¶
Types ¶
type DataKey ¶
DataKey is a KMS-generated data key: Plaintext encrypts locally, Ciphertext goes in the header, and KeyARN is the provider info naming the KMS key.
type Message ¶
type Message struct {
EncryptionContext map[string]string
ProviderID string
ProviderInfo string
EncryptedDataKey []byte
Plaintext []byte
}
Message is a decrypted ESDK message.
func Decrypt ¶
func Decrypt(msg []byte, unwrap func(edk []byte, encCtx map[string]string) ([]byte, error)) (*Message, error)
Decrypt parses and authenticates a v2 committed message following the ESDK data-format spec. unwrap stands in for the keyring: it returns the plaintext data key for the encrypted data key.