import "Smilo-blackbox/src/crypt"
- 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, filepath string) error
- func WritePublicKeyFile(key string, filepath string) error
- type KeyPair
func ComputePublicKey(secret []byte) ([]byte, error)
ComputePublicKey will compute a key based on the secret
func ComputeSharedKey(senderKey []byte, publicKey []byte) []byte
ComputeSharedKey compute a shareKey based on two keys
func DecryptPayload(sharedKey []byte, encryptedPayload []byte, nonce []byte) []byte
DecryptPayload will decrypt a payload based on a key and nonce
func EncryptPayload(sharedKey []byte, payload []byte, nonce []byte) []byte
EncryptPayload will encrypt payload based on a key and nonce
func GenerateKeys(generateKeys string) error
GenerateKeys will generate key/pub and save into file
func GetPrivateKey(publicKey []byte) []byte
GetPrivateKey will get the pk for a pub
func GetPublicKeys() [][]byte
GetPublicKeys will get all pubs in memory
func NewRandomKey() ([]byte, error)
NewRandomKey generate new key
func NewRandomNonce() ([]byte, error)
NewRandomNonce generate new nonce
func PutKeyPair(pair KeyPair)
PutKeyPair will put a pair into pairs var
func WritePrivateKeyFile(key string, filepath string) error
WritePrivateKeyFile creates a json file with the private key
func WritePublicKeyFile(key string, filepath string) error
WritePublicKeyFile creates a file with the pubKey
type KeyPair struct {
PrivateKey []byte
PublicKey []byte
}
KeyPair holds PrivateKey and PublicKey
Generated by godoc2md