Documentation ¶
Index ¶
- Constants
- type Wrapper
- func (k *Wrapper) Decrypt(_ context.Context, in *wrapping.EncryptedBlobInfo, aad []byte) (pt []byte, err error)
- func (k *Wrapper) Encrypt(_ context.Context, plaintext, aad []byte) (blob *wrapping.EncryptedBlobInfo, err error)
- func (k *Wrapper) Finalize(_ context.Context) error
- func (k *Wrapper) HMACKeyID() string
- func (k *Wrapper) Init(_ context.Context) error
- func (k *Wrapper) KeyID() string
- func (k *Wrapper) SetConfig(config map[string]string) (map[string]string, error)
- func (k *Wrapper) Type() string
Constants ¶
View Source
const ( EnvAliCloudKMSWrapperKeyID = "ALICLOUDKMS_WRAPPER_KEY_ID" EnvVaultAliCloudKMSSealKeyID = "VAULT_ALICLOUDKMS_SEAL_KEY_ID" )
These constants contain the accepted env vars; the Vault one is for backwards compat
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper is a Wrapper that uses AliCloud's KMS
func NewWrapper ¶
func NewWrapper(opts *wrapping.WrapperOptions) *Wrapper
NewWrapper creates a new AliCloud Wrapper
func (*Wrapper) Decrypt ¶
func (k *Wrapper) Decrypt(_ context.Context, in *wrapping.EncryptedBlobInfo, aad []byte) (pt []byte, err error)
Decrypt is used to decrypt the ciphertext. This should be called after Init.
func (*Wrapper) Encrypt ¶
func (k *Wrapper) Encrypt(_ context.Context, plaintext, aad []byte) (blob *wrapping.EncryptedBlobInfo, err error)
Encrypt is used to encrypt the master key using the the AliCloud CMK. This returns the ciphertext, and/or any errors from this call. This should be called after the KMS client has been instantiated.
func (*Wrapper) Finalize ¶
Finalize is called during shutdown. This is a no-op since AliCloudKMSWrapper doesn't require any cleanup.
Click to show internal directories.
Click to hide internal directories.