crypt

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputePublicKey

func ComputePublicKey(secret []byte) ([]byte, error)

func ComputeSharedKey

func ComputeSharedKey(senderKey []byte, publicKey []byte) []byte

func DecryptPayload

func DecryptPayload(sharedKey []byte, encrypted_payload []byte, nounce []byte) []byte

func EncryptPayload

func EncryptPayload(sharedKey []byte, payload []byte, nounce []byte) []byte

func GenerateKeys

func GenerateKeys(generateKeys string)

func GetPrivateKey

func GetPrivateKey(publicKey []byte) []byte

func GetPublicKeys

func GetPublicKeys() [][]byte

func NewRandomKey

func NewRandomKey() ([]byte, error)

func NewRandomNonce

func NewRandomNonce() ([]byte, error)

func PutKeyPair

func PutKeyPair(pair KeyPair)

func WritePrivateKeyFile

func WritePrivateKeyFile(key string, filename string) error

WritePrivateKeyFile creates a json file with the private key

func WritePublicKeyFile

func WritePublicKeyFile(key string, filename string) error

WritePublicKeyFile creates a file with the pubKey

Types

type KeyPair

type KeyPair struct {
	PrivateKey []byte
	PublicKey  []byte
}

Jump to

Keyboard shortcuts

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