Documentation ¶
Overview ¶
Package encryption manages content encryption algorithms.
Index ¶
Constants ¶
View Source
const DefaultAlgorithm = "AES256-GCM-HMAC-SHA256"
DefaultAlgorithm is the name of the default encryption algorithm.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name, description string, deprecated bool, newEncryptor EncryptorFactory)
Register registers new encryption algorithm.
func SupportedAlgorithms ¶
SupportedAlgorithms returns the names of the supported encryption methods.
Types ¶
type Encryptor ¶
type Encryptor interface { // Encrypt appends the encrypted bytes corresponding to the given plaintext to a given slice. // Must not clobber the input slice and return ciphertext with additional padding and checksum. Encrypt(plainText gather.Bytes, contentID []byte, output *gather.WriteBuffer) error // Decrypt appends the unencrypted bytes corresponding to the given ciphertext to a given slice. // Must not clobber the input slice. If IsAuthenticated() == true, Decrypt will perform // authenticity check before decrypting. Decrypt(cipherText gather.Bytes, contentID []byte, output *gather.WriteBuffer) error // Overhead is the number of bytes of overhead added by Encrypt() Overhead() int }
Encryptor performs encryption and decryption of contents of data.
func CreateEncryptor ¶
func CreateEncryptor(p Parameters) (Encryptor, error)
CreateEncryptor creates an Encryptor for given parameters.
type EncryptorFactory ¶
type EncryptorFactory func(p Parameters) (Encryptor, error)
EncryptorFactory creates new Encryptor for given parameters.
type Parameters ¶
Parameters encapsulates all encryption parameters.
Click to show internal directories.
Click to hide internal directories.