nacl

package
v0.0.78 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

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

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

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

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL