Documentation
¶
Overview ¶
Package envencrypt holds unobin's built-in encrypters.
The Encrypter contract lives in pkg/sdk/encrypt so provider libraries can register their own implementations. This package implements the env-key encrypter and the no-op pass-through. The core library registers them under runtime.Library.Encrypters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnvKey ¶
type EnvKey struct {
// contains filtered or unexported fields
}
EnvKey uses AES-256-GCM with a 32 byte symmetric key read from a named environment variable. The env value must be the base64-encoded key.
func NewEnvKey ¶
NewEnvKey reads the env var, decodes the key, and returns an EnvKey encrypter. Errors when the env var is unset, not base64, or does not decode to 32 bytes.