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 ¶
func (d PrivateKeyDecrypter) Decrypt(data cipher.EncryptedContent) (cipher.PlainContent, error)
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 ¶
func (e PrivateKeyEncrypter) Encrypt(message cipher.PlainContent) (cipher.EncryptedContent, error)
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 ¶
func (d PublicKeyDecrypter) Decrypt(data cipher.EncryptedContent) (cipher.PlainContent, error)
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 ¶
func (e PublicKeyEncrypter) Encrypt(message cipher.PlainContent) (cipher.EncryptedContent, error)
Encrypt encrypts the message with the key that was attached to it.