const (
TagSize = 16
)
AesContentCipher represents a cipher based on AES
type AesContentCipher struct { NonceGenerator keygen.Generator // contains filtered or unexported fields }
func NewAES(alg jwa.ContentEncryptionAlgorithm) (*AesContentCipher, error)
func (c AesContentCipher) Decrypt(cek, iv, ciphertxt, tag, aad []byte) (plaintext []byte, err error)
func (c AesContentCipher) Encrypt(cek, plaintext, aad []byte) (iv, ciphertext, tag []byte, err error)
func (c AesContentCipher) KeySize() int
func (c AesContentCipher) TagSize() int
ContentCipher knows how to encrypt/decrypt the content given a content encryption key and other data
type ContentCipher interface { KeySize() int Encrypt(cek, aad, plaintext []byte) ([]byte, []byte, []byte, error) Decrypt(cek, iv, aad, ciphertext, tag []byte) ([]byte, error) }
type Fetcher interface { Fetch([]byte) (cipher.AEAD, error) }