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(v []byte) Option
- func WithDh(v []byte) Option
- func WithEncoding(v ContentEncoding) Option
- func WithKey(v []byte) Option
- func WithKeyID(v []byte) Option
- func WithKeyLabel(v []byte) Option
- func WithKeyMap(v KeyMappingFn) Option
- func WithPad(v uint32) Option
- func WithPrivate(v []byte) Option
- func WithRecordSize(v uint32) Option
- func WithSalt(v []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() uint32
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(v ContentEncoding) Option
func WithKeyLabel ¶
func WithKeyMap ¶
func WithKeyMap(v KeyMappingFn) Option
func WithPrivate ¶
func WithRecordSize ¶
Click to show internal directories.
Click to hide internal directories.