Documentation
¶
Index ¶
- Variables
- func Decrypt(content []byte, opts ...Option) ([]byte, error)
- func Encrypt(plaintext []byte, opts ...Option) ([]byte, error)
- type ContentEncoding
- type KeyMappingFn
- type Option
- func WithAuthSecret(value []byte) Option
- func WithDh(value []byte) Option
- func WithEncoding(value ContentEncoding) Option
- func WithKey(value []byte) Option
- func WithKeyID(value []byte) Option
- func WithKeyLabel(value []byte) Option
- func WithKeyMap(value KeyMappingFn) Option
- func WithPadSize(value int) Option
- func WithPrivate(value []byte) Option
- func WithRecordSize(value int) Option
- func WithSalt(value []byte) Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrKeyIDTooLong = errors.New("keyID too long") ErrTruncated = errors.New("content truncated") ErrInvalidPaddingLast = errors.New("last block must start padding with 0x02") ErrInvalidPaddingNonLast = errors.New("non-last block must start padding with 0x01") ErrAllZeroPlaintext = errors.New("all zero plaintext") ErrUnableDetermineKey = errors.New("unable to determine key") ErrNoAuthSecret = errors.New("no authentication secret for webpush") )
Functions ¶
Types ¶
type ContentEncoding ¶
type ContentEncoding string
ContentEncoding is crypto data encoding
const ( AES128GCM ContentEncoding = "aes128gcm" AESGCM ContentEncoding = "aesgcm" )
func (ContentEncoding) Padding ¶
func (i ContentEncoding) Padding() int
Padding returns crypto data padding size.
type KeyMappingFn ¶ added in v0.1.0
type Option ¶
type Option func(*options) error
func WithAuthSecret ¶
func WithEncoding ¶
func WithEncoding(value ContentEncoding) Option
func WithKeyLabel ¶
func WithKeyMap ¶
func WithKeyMap(value KeyMappingFn) Option
func WithPadSize ¶ added in v0.7.0
func WithPrivate ¶
func WithRecordSize ¶
Click to show internal directories.
Click to hide internal directories.