Versions in this module Expand all Collapse all v0 v0.1.0 Oct 12, 2026 Changes in this version + const DefaultPageSize + const MaxPageSize + var ErrConflict = errors.New("registry: record changed") + var ErrInvalid = errors.New("registry: invalid record") + var ErrInvalidTransition = errors.New("registry: invalid state transition") + var ErrKEKExists = errors.New("registry: KEK already exists") + var ErrNoRollbackTarget = errors.New("registry: not the most recent decrypt-only version") + var ErrPurposeBound = errors.New("registry: purpose already has an active KEK") + var ErrRetireDelay = errors.New("registry: retirement delay has not passed") + var ErrSentinelNotFound = errors.New("registry: sentinel not found") + var ErrShredNotFound = errors.New("registry: shred not found") + var ErrShredPending = errors.New("registry: a KEK version that wrapped the subject's keys still exists") + var ErrVersionExists = errors.New("registry: KEK version already exists or is not newer") + var ErrVersionNotFound = errors.New("registry: KEK version not found") + var ErrVersionReferenced = errors.New("registry: KEK version is still referenced by data keys") + var ErrVersionUnusable = errors.New("registry: KEK version cannot wrap data keys") + var VersionStates = []VersionState + func CanTransition(from, to VersionState) bool + func CheckDEKTransition(from, to keyforge.DEKState) error + func CheckTransition(from, to VersionState) error + type DEKFilter struct + After envelope.ID + KEKID envelope.ID + KEKVersion uint32 + Limit int + Purpose keyforge.Purpose + func (f DEKFilter) PageSize() int + type DEKTransitionError struct + From keyforge.DEKState + To keyforge.DEKState + func (e *DEKTransitionError) Error() string + func (e *DEKTransitionError) Unwrap() error + type KEK struct + CreatedAt time.Time + ID envelope.ID + Provider string + ProviderRef string + Purpose keyforge.Purpose + State KeyState + func (k KEK) Ref() provider.KeyRef + func (k KEK) Validate() error + type KeyState uint8 + const KeyActive + const KeyRetired + func (s KeyState) String() string + type Rewrap struct + FromKEKID envelope.ID + FromVersion uint32 + ID envelope.ID + ToKEKID envelope.ID + ToVersion uint32 + Wrapped []byte + type Sentinel struct + CreatedAt time.Time + Envelope string + KEKID envelope.ID + Version uint32 + type ShredRecord struct + CompletedAt time.Time + DEKs int + Purpose keyforge.Purpose + RequestedAt time.Time + Subject string + Versions []keyforge.KEKVersionRef + func (r ShredRecord) Complete() bool + type Store interface + AddVersion func(ctx context.Context, v VersionRecord) error + CompleteShred func(ctx context.Context, purpose keyforge.Purpose, subject string, at time.Time) (ShredRecord, error) + CountDEKStates func(ctx context.Context, purpose keyforge.Purpose) (map[keyforge.DEKState]int, error) + CountDEKs func(ctx context.Context, kekID envelope.ID, version uint32) (int, error) + CreateKEK func(ctx context.Context, k KEK) error + GetKEK func(ctx context.Context, id envelope.ID) (KEK, error) + GetSentinel func(ctx context.Context, kekID envelope.ID, version uint32) (Sentinel, error) + GetShred func(ctx context.Context, purpose keyforge.Purpose, subject string) (ShredRecord, error) + GetVersion func(ctx context.Context, kekID envelope.ID, version uint32) (VersionRecord, error) + KEKForPurpose func(ctx context.Context, purpose keyforge.Purpose) (KEK, error) + ListDEKs func(ctx context.Context, f DEKFilter) ([]keyforge.DEKRecord, error) + ListKEKs func(ctx context.Context) ([]KEK, error) + ListSentinels func(ctx context.Context, kekID envelope.ID) ([]Sentinel, error) + ListShreds func(ctx context.Context) ([]ShredRecord, error) + ListVersions func(ctx context.Context, kekID envelope.ID) ([]VersionRecord, error) + MarkDEK func(ctx context.Context, id envelope.ID, to keyforge.DEKState) error + PutSentinel func(ctx context.Context, s Sentinel) error + RewrapDEK func(ctx context.Context, r Rewrap) error + ShredSubject func(ctx context.Context, purpose keyforge.Purpose, subject string, at time.Time) (ShredRecord, error) + TransitionVersion func(ctx context.Context, kekID envelope.ID, version uint32, to VersionState, ...) error + type TransitionError struct + From VersionState + To VersionState + func (e *TransitionError) Error() string + func (e *TransitionError) Unwrap() error + type TransitionOptions struct + At time.Time + RetireAfter time.Time + type VersionRecord struct + ActivatedAt time.Time + CreatedAt time.Time + KEKID envelope.ID + ProviderRef string + RetireAfter time.Time + RotatedAt time.Time + State VersionState + Version uint32 + func (v VersionRecord) Ref(kek KEK) keyforge.KEKVersion + type VersionState uint8 + const VersionActive + const VersionCompromised + const VersionDecryptOnly + const VersionDestroyed + const VersionPending + const VersionRetireRequested + const VersionRetired + func (s VersionState) CanUnwrap() bool + func (s VersionState) CanWrap() bool + func (s VersionState) String() string + func (s VersionState) Valid() bool