Documentation ¶
Index ¶
- Constants
- func DecryptStream(input io.Reader, output io.Writer, privateKey PrivateKey) error
- func DeriveEncryptionKey(privateKy PrivateKey, publicKey PublicKey) (encryptionKey []byte, err error)
- func EncryptStream(input io.Reader, output io.Writer, publicKey PublicKey) error
- func GenKeyPair() (privateKey PrivateKey, publicKey PublicKey, err error)
- type PrivateKey
- type PublicKey
Constants ¶
View Source
const PrivateKeySize = curve25519.ScalarSize
View Source
const PublicKeySize = curve25519.PointSize
Variables ¶
This section is empty.
Functions ¶
func DecryptStream ¶
func DeriveEncryptionKey ¶
func DeriveEncryptionKey(privateKy PrivateKey, publicKey PublicKey) (encryptionKey []byte, err error)
DeriveEncryptionKey derives a "shared key" from two key pair (Private and Public key from different party). Each of those combination will be able to derive the same "shared key" suitable for encryption (e.g. AES) The return value should be a 32-byte (256-bit) key.
func EncryptStream ¶
EncryptStream encrypts a given stream with ECC key (curve25519 public key) and AES.
func GenKeyPair ¶
func GenKeyPair() (privateKey PrivateKey, publicKey PublicKey, err error)
GenKeyPair generates a pair of keys that is suitable for
Types ¶
type PrivateKey ¶
type PrivateKey = []byte
func GenPrivateKey ¶
func GenPrivateKey() (privateKey PrivateKey, err error)
GenPrivateKey generates a private key.
type PublicKey ¶
type PublicKey = []byte
func GetPublicKey ¶
func GetPublicKey(privateKey PrivateKey) (publicKey PublicKey, err error)
Click to show internal directories.
Click to hide internal directories.