mailchain: Index | Files

package nacl

import ""


Package Files

decrypter.go encoding.go encrypter.go keyexchange.go nacl.go

type Decrypter Uses

type Decrypter struct {
    // contains filtered or unexported fields

Decrypter will decrypt data using NACL with ECDH key exchange

func NewDecrypter Uses

func NewDecrypter(privateKey crypto.PrivateKey) (*Decrypter, error)

NewDecrypter create a new decrypter attaching the private key to it

func (Decrypter) Decrypt Uses

func (d Decrypter) Decrypt(data cipher.EncryptedContent) (cipher.PlainContent, error)

Decrypt data using recipient private key with AES in CBC mode.

type Encrypter Uses

type Encrypter struct {
    // contains filtered or unexported fields

Encrypter will encrypt data using AES256CBC method.

func NewEncrypter Uses

func NewEncrypter(publicKey crypto.PublicKey) (*Encrypter, error)

NewEncrypter creates a new encrypter with crypto rand for reader, and attaching the public key to the encrypter.

func (Encrypter) Encrypt Uses

func (e Encrypter) Encrypt(message cipher.PlainContent) (cipher.EncryptedContent, error)

Encrypt encrypts the message with the key that was attached to it.

Package nacl imports 11 packages (graph) and is imported by 2 packages. Updated 2020-02-29. Refresh now. Tools for package owners.