Documentation
¶
Overview ¶
Package keeper defines the envelope-encryption contract implemented by the KMS connections (AWS KMS, GCP KMS, Azure Key Vault) and the local keeper. It is a leaf package so that connection and secret can share it without linking any cloud SDK.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper interface {
Encrypt(ctx context.Context, plaintext []byte) ([]byte, error)
Decrypt(ctx context.Context, ciphertext []byte) ([]byte, error)
Close() error
}
Keeper encrypts and decrypts small payloads such as secrets and connection credentials. Implementations return errors that name the backend and key.
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
Local encrypts with NaCl secretbox under a 32-byte key. Its ciphertext is the random nonce followed by the sealed message, byte-compatible with gocloud.dev/secrets/localsecrets, so data written by the previous keeper still decrypts.
func NewLocalFromBase64 ¶
NewLocalFromBase64 builds a Local keeper from a url-safe base64 32-byte key.