Documentation ¶
Index ¶
- func ComputePublicKey(secret []byte) ([]byte, error)
- func ComputeSharedKey(senderKey []byte, publicKey []byte) []byte
- func DecryptPayload(sharedKey []byte, encryptedPayload []byte, nonce []byte) []byte
- func EncryptPayload(sharedKey []byte, payload []byte, nonce []byte) []byte
- func GenerateKeys(generateKeys string) error
- func GetPrivateKey(publicKey []byte) []byte
- func GetPublicKeys() [][]byte
- func NewRandomKey() ([]byte, error)
- func NewRandomNonce() ([]byte, error)
- func PutKeyPair(pair KeyPair)
- func WritePrivateKeyFile(key string, filename string) error
- func WritePublicKeyFile(key string, filename string) error
- type KeyPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputePublicKey ¶
ComputePublicKey will compute a key based on the secret
func ComputeSharedKey ¶
ComputeSharedKey compute a shareKey based on two keys
func DecryptPayload ¶
DecryptPayload will decrypt a payload based on a key and nonce
func EncryptPayload ¶
EncryptPayload will encrypt payload based on a key and nonce
func GenerateKeys ¶
GenerateKeys will generate key/pub and save into file
func GetPrivateKey ¶
GetPrivateKey will get the pk for a pub
func WritePrivateKeyFile ¶
WritePrivateKeyFile creates a json file with the private key
func WritePublicKeyFile ¶
WritePublicKeyFile creates a file with the pubKey
Types ¶
Click to show internal directories.
Click to hide internal directories.