Documentation ¶
Index ¶
- func DecryptAES(key, ciphertext, nonce, aad []byte) ([]byte, error)
- func DeriveSharedKey(secret, ourPublic, theirPublic []byte) ([]byte, error)
- func EncryptAES(key, plaintext, aad []byte) ([]byte, []byte, error)
- func GeneratePublicPrivateKey() ([]byte, []byte, error)
- func GenerateSharedSecret(ourPrivate, theirPublic []byte) ([]byte, error)
- type Envelope
- type PublicKeyInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptAES ¶
Use AES256-GCM to decrypt some ciphertext with a provided key and nonce. The returned values are the plaintext and error respectively.
func DeriveSharedKey ¶
DeriveSharedKey uses HKDF to derive a key from a shared secret and public keys
func EncryptAES ¶
Use AES256-GCM to encrypt some plaintext with a provided key. The returned values are the ciphertext, the nonce, and error respectively.
func GeneratePublicPrivateKey ¶
generatePublicPrivateKey uses curve25519 to generate a public and private key pair.
func GenerateSharedSecret ¶
GenerateSharedSecret uses the private key and the other party's public key to generate the shared secret.
Types ¶
type PublicKeyInfo ¶
type PublicKeyInfo struct {
Curve25519PublicKey []byte `json:"curve25519_public_key"`
}
Click to show internal directories.
Click to hide internal directories.