Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileKeyConfig ¶
type FileKeyConfig struct {
// KeyPaths maps key IDs to file paths containing base64-encoded keys.
KeyPaths map[string]string
ActiveKeyID string
}
FileKeyConfig holds the configuration for loading keys from files.
type Keyring ¶
type Keyring interface {
// ActiveKey returns the current active key and its identifier.
ActiveKey() (key []byte, keyID string)
// Key returns the key for the given identifier.
Key(keyID string) ([]byte, error)
}
Keyring provides access to system-level encryption keys.
func NewKeyring ¶
NewKeyring creates a Keyring backed by the provided in-memory keys. It panics if activeKeyID is not present in keys.
func NewKeyringFromFiles ¶
func NewKeyringFromFiles(cfg FileKeyConfig) (Keyring, error)
NewKeyringFromFiles reads base64-encoded 32-byte keys from the configured file paths and returns a memoryKeyring.
Click to show internal directories.
Click to hide internal directories.