Documentation ¶
Index ¶
- func BoxOpen(out, b []byte, nonce *[24]byte, peersPublicKey, privateKey *[32]byte) ([]byte, bool)
- func BoxSeal(out, message []byte, nonce *[24]byte, peersPublicKey, privateKey *[32]byte) []byte
- func Decrypt(data *[]byte, pubKey, privKey *Key) ([]byte, error)
- func DecryptFile(in, out string, pubKey, privKey *Key) error
- func DecryptMsg(message string, pubKey, privKey *Key) ([]byte, error)
- func Encrypt(data *[]byte, pubKey, privKey *Key) ([]byte, error)
- func EncryptFile(in, out string, pubKey, privKey *Key) error
- func EncryptMsg(message []byte, pubKey, privKey *Key) (string, error)
- func GenerateKey(rand io.Reader) (publicKey, privateKey *[32]byte, err error)
- func GetHomeDir() (string, error)
- type Key
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoxOpen ¶
BoxOpen authenticates and decrypts a box produced by Seal and appends the message to out, which must not overlap box. The output will be Overhead bytes smaller than box.
func BoxSeal ¶
BoxSeal appends an encrypted and authenticated copy of message to out, which will be Overhead bytes longer than the original and must not overlap. The nonce must be unique for each distinct message for a given pair of keys.
func DecryptFile ¶
func EncryptFile ¶
EncryptFile encrypt in to out
func EncryptMsg ¶
EncryptMsg encrypt a message
func GenerateKey ¶
GenerateKey generates a new public/private key pair suitable for use with Seal and Open.
func GetHomeDir ¶
GetHomeDir returns the home dir of the current user as user.Current is not implemented on darwin/amd64 we must find a workaround...
Types ¶
type Key ¶
Key represent a key
func KeyFromHomeDir ¶
GetUserKeyFromHomeDir returns public or private key of current user loade from his home dir
func KeyFromString ¶
KeyFromString return key struct from string