Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Length of nacl nonce NonceBytes = 24 // Length of nacl ephemeral public key EphemeralPublicKeyBytes = 32 )
Variables ¶
View Source
var ( // Nacl box decryption failed BoxDecryptionError = fmt.Errorf("failed to decrypt curve25519") )
Functions ¶
This section is empty.
Types ¶
type DecryptionKey ¶
type DecryptionKey struct {
// contains filtered or unexported fields
}
DecryptionKey is a private key wrapper that can perform decryption.
func NewDecryptionKey ¶
func NewDecryptionKey(sk ic.PrivKey) (*DecryptionKey, error)
NewDecryptionKey returns a key by parsing k into a private key.
func (*DecryptionKey) Decrypt ¶
func (k *DecryptionKey) Decrypt(ciphertext []byte) ([]byte, error)
Decrypt ciphertext with a private key.
func (*DecryptionKey) Encrypt ¶
func (k *DecryptionKey) Encrypt(plaintext []byte) ([]byte, error)
Encrypt bytes with a public key.
func (*DecryptionKey) Marshal ¶
func (k *DecryptionKey) Marshal() ([]byte, error)
Marshal returns raw key bytes.
type EncryptionKey ¶
type EncryptionKey struct {
// contains filtered or unexported fields
}
EncryptionKey is a public key wrapper that can perform encryption.
func NewEncryptionKey ¶
func NewEncryptionKey(pk ic.PubKey) (*EncryptionKey, error)
NewEncryptionKey returns a key by parsing k into a public key.
func (*EncryptionKey) Encrypt ¶
func (k *EncryptionKey) Encrypt(plaintext []byte) ([]byte, error)
Encrypt bytes with a public key.
func (*EncryptionKey) Marshal ¶
func (k *EncryptionKey) Marshal() ([]byte, error)
Marshal returns raw key bytes.
Click to show internal directories.
Click to hide internal directories.