Documentation
¶
Overview ¶
Package crypto provides envelope encryption for secrets stored at rest in the metadata database. Per-org Arc API keys are encrypted with AES-256-GCM using a master key supplied via the MEMTRACE_MASTER_KEY environment variable.
Index ¶
Constants ¶
View Source
const ( // MasterKeyEnvVar is the environment variable Memtrace reads to obtain the // 32-byte master key (base64-encoded) used for envelope encryption. MasterKeyEnvVar = "MEMTRACE_MASTER_KEY" )
Variables ¶
This section is empty.
Functions ¶
func GenerateMasterKey ¶
GenerateMasterKey returns a fresh, base64-encoded 32-byte master key. Used by `memtrace keygen master` to print a key for operators to set in their env.
Types ¶
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
Cipher encrypts and decrypts byte slices using AES-256-GCM.
func NewCipherFromEnv ¶
NewCipherFromEnv reads the master key from MEMTRACE_MASTER_KEY (base64-encoded 32 bytes) and returns a Cipher. Returns a clear error if the variable is missing or malformed so the server can refuse to start.
Click to show internal directories.
Click to hide internal directories.