Documentation ¶
Index ¶
- Constants
- type AWSKMSMechanism
- type AWSKMSSeal
- func (k *AWSKMSSeal) Decrypt(_ context.Context, in *physical.EncryptedBlobInfo) (pt []byte, err error)
- func (k *AWSKMSSeal) Encrypt(_ context.Context, plaintext []byte) (blob *physical.EncryptedBlobInfo, err error)
- func (k *AWSKMSSeal) Finalize(_ context.Context) error
- func (k *AWSKMSSeal) Init(_ context.Context) error
- func (k *AWSKMSSeal) KeyID() string
- func (k *AWSKMSSeal) SealType() string
- func (k *AWSKMSSeal) SetConfig(config map[string]string) (map[string]string, error)
Constants ¶
const ( // AWSKMSEncrypt is used to directly encrypt the data with KMS AWSKMSEncrypt = iota // AWSKMSEnvelopeAESGCMEncrypt is when a data encryption key is generated and // the data is encrypted with AESGCM and the key is encrypted with KMS AWSKMSEnvelopeAESGCMEncrypt )
const (
// EnvAWSKMSSealKeyID is the AWS KMS key ID to use for encryption and decryption
EnvAWSKMSSealKeyID = "VAULT_AWSKMS_SEAL_KEY_ID"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSKMSMechanism ¶
type AWSKMSMechanism uint32
AWSKMSMechanism is the method used to encrypt/decrypt in the autoseal
type AWSKMSSeal ¶
type AWSKMSSeal struct {
// contains filtered or unexported fields
}
AWSKMSSeal represents credentials and Key information for the KMS Key used to encryption and decryption
func NewAWSKMSTestSeal ¶
func NewAWSKMSTestSeal() *AWSKMSSeal
func NewSeal ¶
func NewSeal(logger log.Logger) *AWSKMSSeal
NewSeal creates a new AWSKMS seal with the provided logger
func (*AWSKMSSeal) Decrypt ¶
func (k *AWSKMSSeal) Decrypt(_ context.Context, in *physical.EncryptedBlobInfo) (pt []byte, err error)
Decrypt is used to decrypt the ciphertext. This should be called after Init.
func (*AWSKMSSeal) Encrypt ¶
func (k *AWSKMSSeal) Encrypt(_ context.Context, plaintext []byte) (blob *physical.EncryptedBlobInfo, err error)
Encrypt is used to encrypt the master key using the the AWS CMK. This returns the ciphertext, and/or any errors from this call. This should be called after the KMS client has been instantiated.
func (*AWSKMSSeal) Finalize ¶
func (k *AWSKMSSeal) Finalize(_ context.Context) error
Finalize is called during shutdown. This is a no-op since AWSKMSSeal doesn't require any cleanup.
func (*AWSKMSSeal) Init ¶
func (k *AWSKMSSeal) Init(_ context.Context) error
Init is called during core.Initialize. No-op at the moment.
func (*AWSKMSSeal) SealType ¶
func (k *AWSKMSSeal) SealType() string
SealType returns the seal type for this particular seal implementation.