Versions in this module Expand all Collapse all v0 v0.1.0 Aug 1, 2026 Changes in this version + const AlgAES256GCM + const ChunkSize + const DEKSize + const Version1 + var ErrBadDEK = errors.New("envelope: data key must be 32 bytes") + var ErrCorrupt = errors.New("envelope: corrupt or tampered ciphertext") + var ErrNoTenant = errors.New("envelope: tenant required") + var ErrNotEnvelope = errors.New("envelope: not an envelope") + var ErrUnsupported = errors.New("envelope: unsupported version or algorithm") + var Magic = []byte("OTIUMENC") + func HeaderTenant(b []byte) (string, error) + func IsEnvelope(b []byte) bool + func Open(ctx context.Context, data []byte, binding string, unwrap UnwrapFunc) ([]byte, error) + func OpenString(ctx context.Context, data []byte, binding string, unwrap UnwrapFunc) (string, error) + func Seal(p Params, plaintext []byte) ([]byte, error) + func SealString(p Params, plaintext string) ([]byte, error) + func SealedSize(p Params, n int64) int64 + type Params struct + Binding string + DEK []byte + KeyID string + Tenant string + Wrapped []byte + type Reader struct + func NewReader(ctx context.Context, r io.Reader, binding string, unwrap UnwrapFunc) (*Reader, error) + func (d *Reader) Close() error + func (d *Reader) Read(p []byte) (int, error) + type UnwrapFunc func(ctx context.Context, tenant string, wrapped []byte, keyID string) ([]byte, error) + type Writer struct + func NewWriter(w io.Writer, p Params) (*Writer, error) + func (e *Writer) Close() error + func (e *Writer) Write(p []byte) (int, error)