keymgmt

package
v0.0.0-...-4b98c26 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateEncodedNACLKeyPair

func GenerateEncodedNACLKeyPair() (marshaledEncryptorKey []byte, marshaledDecryptorKey []byte, err error)

GenerateEncodedNACLKeyPair returns to byte slice containing the encoded values of the couple of keypairs freshly generated.

func GenerateKeyPair

func GenerateKeyPair(r io.Reader) (encryptorKey *NACLKey, decryptorKey *NACLKey, err error)

GenerateKeyPair returns a couple keypairs that can be used for asymmetric encryption/decryption using nacl crypto box API.

func MarshalNACLKey

func MarshalNACLKey(key *NACLKey) []byte

MarshalNACLKey takes a key and returns its encoded version.

Types

type NACLKey

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

NACLKey contains a NACL crypto box keypair.

func UnmarshalNACLKey

func UnmarshalNACLKey(marshaledKey []byte) (key *NACLKey, err error)

UnmarshalNACLKey takes and encoded value of a keypair and unmarshal its value, returning the associated key.

func (*NACLKey) PrivateKey

func (n *NACLKey) PrivateKey() *[32]byte

PrivateKey returns the private part of the keypair.

func (*NACLKey) PublicKey

func (n *NACLKey) PublicKey() *[32]byte

PublicKey returns the public part of the keypair.

Jump to

Keyboard shortcuts

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