systemkey

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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

func NewKeyring(keys map[string][]byte, activeKeyID string) Keyring

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL