awskms

package
v1.1.0-beta1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2019 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
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
)
View Source
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) ([]byte, 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) (*physical.EncryptedBlobInfo, 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) KeyID

func (k *AWSKMSSeal) KeyID() string

KeyID returns the last known key id.

func (*AWSKMSSeal) SealType

func (k *AWSKMSSeal) SealType() string

SealType returns the seal type for this particular seal implementation.

func (*AWSKMSSeal) SetConfig

func (k *AWSKMSSeal) SetConfig(config map[string]string) (map[string]string, error)

SetConfig sets the fields on the AWSKMSSeal object based on values from the config parameter.

Order of precedence AWS values: * Environment variable * Value from Vault configuration file * Instance metadata role (access key and secret key) * Default values

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL