mailchain: github.com/mailchain/mailchain/crypto/cipher/nacl Index | Files

package nacl

import "github.com/mailchain/mailchain/crypto/cipher/nacl"

Index

Package Files

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

type Decrypter Uses

type Decrypter struct {
    // contains filtered or unexported fields
}

Decrypter will decrypt data using AES256CBC method

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() Encrypter

NewEncrypter create a new encrypter with crypto rand for reader

func (Encrypter) Encrypt Uses

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

Encrypt contents with the recipients public key.

Package nacl imports 8 packages (graph) and is imported by 1 packages. Updated 2019-12-12. Refresh now. Tools for package owners.