Documentation
¶
Overview ¶
Package vault encrypts secrets at rest (XChaCha20-Poly1305, AAD = record id) and provides a string type that never prints its value.
Index ¶
Constants ¶
const KeySize = chacha20poly1305.KeySize
KeySize is the master key length in bytes.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Redacted ¶
type Redacted string
Redacted is a secret string: every formatting path prints [REDACTED]. Use Reveal at the single place the value is really needed.
func (Redacted) MarshalJSON ¶
func (Redacted) MarshalText ¶
type Vault ¶
type Vault struct {
// contains filtered or unexported fields
}
Vault seals and opens secrets with the master key.
func (*Vault) Derive ¶
Derive is a key of KeySize bytes for one purpose (HKDF-SHA256 of the master key, the label as context): the same master key and label always give the same key, and keys of different labels reveal nothing about each other or about the master key. For values that must be recomputable without storing anything (page passwords).