Versions in this module Expand all Collapse all v0 v0.75.0 Nov 21, 2026 v0.74.0 Nov 19, 2026 Changes in this version + const MaxPlaintextLen + var ErrContextNUL = errors.New("tokenseal: bucket and bucket key must not contain NUL") + var ErrInvalidKey = errors.New("is not a base64-encoded 32-byte key") + var ErrPlaintextTooLarge = errors.New("tokenseal: plaintext is larger than 1 MiB") + type Key struct + func ParseKey(b64 string) (*Key, error) + func (k *Key) GoString() string + func (k *Key) ID() string + func (k *Key) Open(bucket, bucketKey string, value []byte) ([]byte, error) + func (k *Key) Seal(bucket, bucketKey string, plaintext []byte) ([]byte, error) + func (k *Key) String() string + type OpenError struct + KeyKID string + Reason Reason + RowKID string + func (e *OpenError) Error() string + type Reason string + const ReasonAuthFailed + const ReasonKeyMismatch + const ReasonMalformed + const ReasonNoKey + const ReasonUnsupportedVersion + type Shape int + const ShapeMalformed + const ShapePlaintext + const ShapeSealedV1 + const ShapeUnsupported + func Classify(value []byte) (Shape, string) + func (s Shape) String() string