Versions in this module Expand all Collapse all v0 v0.1.0 Oct 12, 2026 Changes in this version + var ErrInvalidSelection = errors.New("algorithm: invalid selection") + var ErrKeySize = errors.New("algorithm: wrong key size") + var ErrNoPermitted = errors.New("algorithm: no permitted algorithm") + var ErrNotPermitted = errors.New("algorithm: not permitted by the profile") + var ErrUnknown = errors.New("algorithm: unknown algorithm") + var ErrUnknownProfile = errors.New("algorithm: unknown profile") + func New(id ID, key []byte) (cipher.AEAD, error) + type Config struct + Deny []ID + Profile Profile + type ID uint8 + const AES256GCM + func (id ID) KeySize() int + func (id ID) NonceSize() int + func (id ID) String() string + func (id ID) TagSize() int + func (id ID) Valid() bool + type NotPermittedError struct + Algorithm ID + Profile Profile + func (e *NotPermittedError) Error() string + func (e *NotPermittedError) Unwrap() error + type Profile uint8 + const ProfileFIPS + const ProfileStandard + func DefaultProfile() Profile + func ParseProfile(s string) (Profile, error) + func (p Profile) Algorithms() []ID + func (p Profile) Permits(id ID) bool + func (p Profile) String() string + func (p Profile) Valid() bool + type Selection struct + Allowed []ID + Profile Profile + type Selector struct + func NewSelector(cfg Config) (*Selector, error) + func (s *Selector) Check(id ID, sel Selection) error + func (s *Selector) CheckWrite(id ID, sel Selection) error + func (s *Selector) Profile() Profile + func (s *Selector) Select(sel Selection) (ID, error) + func (s *Selector) String() string + func (s *Selector) Validate(purposes map[string]Selection) error + func (s *Selector) ValidateSelection(sel Selection) error