Documentation
¶
Overview ¶
Package keys wires keyforge into SystemForge (ADR-013): one key library for every encryption need on the platform, with the root key read through omnivault and lifecycle events sent to the platform audit trail.
This first version runs keyforge's single-host setup: the keyring and its registry live together in one directory, so they are backed up together.
Index ¶
- func VaultSource(v vault.Vault, path string) local.RootKeySource
- type Keys
- func (k *Keys) Client() *keyforge.Client
- func (k *Keys) Close() error
- func (k *Keys) Open(ctx context.Context, purpose keyforge.Purpose, sealed, aad []byte) ([]byte, error)
- func (k *Keys) Ready(ctx context.Context) error
- func (k *Keys) Run(ctx context.Context) error
- func (k *Keys) Seal(ctx context.Context, purpose keyforge.Purpose, plaintext, aad []byte) ([]byte, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VaultSource ¶
func VaultSource(v vault.Vault, path string) local.RootKeySource
VaultSource returns a root key source that reads the key from a secret in an omnivault vault. The secret holds 32 bytes as standard base64 or as 64 hex digits, the forms keyforge accepts from a file or the environment.
Types ¶
type Keys ¶
type Keys struct {
// contains filtered or unexported fields
}
Keys is a running key system.
func (*Keys) Open ¶
func (k *Keys) Open(ctx context.Context, purpose keyforge.Purpose, sealed, aad []byte) ([]byte, error)
Open decrypts a binary envelope produced by Keys.Seal with the same purpose and aad.
type Options ¶
type Options struct {
// Dir holds the keyring, the registry and the job state. Required.
Dir string
// Root supplies the root key that protects the keyring, for example
// [VaultSource]. It must not be a file in Dir. Required.
Root local.RootKeySource
// Purposes are the purposes to manage. Each gets a key on first start.
// Required.
Purposes []keyforge.Purpose
// Audit receives key lifecycle events. Optional.
Audit sfaudit.Store
// AcceptRollback opens a keyring older than one this host has seen, as
// restoring from backup produces. Set it only after confirming the restore.
AcceptRollback bool
}
Options configures Open.