Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decrypter ¶
type Decrypter struct {
// contains filtered or unexported fields
}
Decrypter will decrypt data using NACL with ECDH key exchange
func NewDecrypter ¶
func NewDecrypter(privateKey crypto.PrivateKey) (*Decrypter, error)
NewDecrypter create a new decrypter attaching the private key to it
func (Decrypter) Decrypt ¶
func (d Decrypter) Decrypt(data cipher.EncryptedContent) (cipher.PlainContent, error)
Decrypt data using recipient private key with AES in CBC mode.
type Encrypter ¶
type Encrypter struct {
// contains filtered or unexported fields
}
Encrypter will encrypt data using AES256CBC method.
func NewEncrypter ¶
NewEncrypter creates a new encrypter with crypto rand for reader, and attaching the public key to the encrypter.
func (Encrypter) Encrypt ¶
func (e Encrypter) Encrypt(message cipher.PlainContent) (cipher.EncryptedContent, error)
Encrypt encrypts the message with the key that was attached to it.
Click to show internal directories.
Click to hide internal directories.