Versions in this module Expand all Collapse all v0 v0.1.0 Oct 12, 2026 Changes in this version + const FormatVersion + const MaxPurposeLen + const MaxWrappedLen + const NonceSize + var ErrAuthentication = errors.New("envelope: authentication failed") + var ErrBadMagic = errors.New("envelope: bad magic") + var ErrBadTextForm = errors.New("envelope: bad text form") + var ErrInvalidHeader = errors.New("envelope: invalid header") + var ErrInvalidPurpose = errors.New("envelope: invalid purpose") + var ErrNotRandomNonce = errors.New("envelope: AEAD must generate its own nonce") + var ErrTruncated = errors.New("envelope: truncated input") + var ErrUnknownAlgorithm = errors.New("envelope: unknown algorithm") + var ErrUnknownMode = errors.New("envelope: unknown mode") + var ErrUnsupportedFlags = errors.New("envelope: unsupported flags") + var ErrUnsupportedFormat = errors.New("envelope: unsupported format version") + func ValidPurpose(p string) bool + type Envelope struct + Ciphertext []byte + Nonce [NonceSize]byte + func Parse(b []byte) (*Envelope, error) + func ParseText(s string) (*Envelope, error) + func Seal(aead cipher.AEAD, h Header, plaintext, context []byte) (*Envelope, error) + func (e *Envelope) MarshalBinary() ([]byte, error) + func (e *Envelope) MarshalText() ([]byte, error) + func (e *Envelope) Open(aead cipher.AEAD, context []byte) ([]byte, error) + func (e *Envelope) String() string + func (e *Envelope) UnmarshalText(text []byte) error + type Header struct + Algorithm algorithm.ID + DEKID ID + KEKID ID + KEKVersion uint32 + Mode Mode + Purpose string + Wrapped []byte + func (h *Header) AAD(context []byte) ([]byte, error) + func (h *Header) Validate() error + type ID [16]byte + func (id *ID) Scan(src any) error + func (id *ID) UnmarshalText(text []byte) error + func (id ID) IsZero() bool + func (id ID) MarshalText() ([]byte, error) + func (id ID) String() string + func (id ID) Value() (driver.Value, error) + type Mode uint8 + const ModeInline + const ModeReference + func (m Mode) String() string + type ValueError struct + Kind error + Value uint8 + func (e *ValueError) Error() string + func (e *ValueError) Unwrap() error