Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyPair ¶
type KeyPair struct { PublicKey PublicKey PrivateKey PrivateKey }
KeyPair represents a public/private key pair.
func GenerateKey ¶
GenerateKey generates a new X25519 key pair.
type PrivateKey ¶
type PrivateKey []byte
func DecodePrivateKey ¶
func DecodePrivateKey(key string) (PrivateKey, error)
DecodePrivateKey return the PrivateKey decoded from the hexadecimal encoding.
func (*PrivateKey) Encode ¶
func (k *PrivateKey) Encode() string
Encode returns the hexadecimal encoding of PrivateKey.
type PublicKey ¶
type PublicKey []byte
PublicKey represents a public key.
func DecodePublicKey ¶
DecodePublicKey return the PublicKey decoded from the hexadecimal encoding.
func PublicFromPrivate ¶
func PublicFromPrivate(privateKey PrivateKey) (PublicKey, error)
PublicFromPrivate returns the public key corresponding to the given private key.
type SharedSecret ¶
type SharedSecret []byte
SharedSecret represents a shared secret.
func ComputeSharedSecret ¶
func ComputeSharedSecret(outPrivate PrivateKey, theirPublic PublicKey) (SharedSecret, error)
ComputeSharedSecret returns a shared secret between the two given keys.
func (*SharedSecret) Encode ¶
func (s *SharedSecret) Encode() string
Encode returns the hexadecimal encoding of SharedSecret.
Click to show internal directories.
Click to hide internal directories.