nacl

package
v0.0.0-...-72bc2f9 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrivateKeyDecrypter

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

PrivateKeyDecrypter will decrypt data using NACL with ECDH key exchange

func NewPrivateKeyDecrypter

func NewPrivateKeyDecrypter(privateKey crypto.PrivateKey) (*PrivateKeyDecrypter, error)

NewPrivateKeyDecrypter create a new decrypter attaching the private key to it

func (PrivateKeyDecrypter) Decrypt

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

type PrivateKeyEncrypter

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

PrivateKeyEncrypter will encrypt data using AES256CBC method.

func NewPrivateKeyEncrypter

func NewPrivateKeyEncrypter(privateKey crypto.PrivateKey) (*PrivateKeyEncrypter, error)

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

func (PrivateKeyEncrypter) Encrypt

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

type PublicKeyDecrypter

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

PublicKeyDecrypter will decrypt data using NACL with ECDH key exchange

func NewPublicKeyDecrypter

func NewPublicKeyDecrypter(privateKey crypto.PrivateKey) (*PublicKeyDecrypter, error)

NewPublicKeyDecrypter create a new decrypter attaching the private key to it

func (PublicKeyDecrypter) Decrypt

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

type PublicKeyEncrypter

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

PublicKeyEncrypter will encrypt data using AES256CBC method.

func NewPublicKeyEncrypter

func NewPublicKeyEncrypter(publicKey crypto.PublicKey) (*PublicKeyEncrypter, error)

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

func (PublicKeyEncrypter) Encrypt

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