Documentation ¶
Index ¶
- func EncryptSecretKey(rand io.Reader, skw io.Writer, sk *SecretKey, passphrase []byte, ...) error
- func GenerateKeys(rand io.Reader, pkw, skw io.Writer, passphrase []byte, kdfp *Argon2idParams, ...) (fingerprint string, err error)
- func OpenSecretKey(r io.Reader, passphrase []byte) (_ *SecretKey, _ Keyfields, err error)
- type Argon2idParams
- type Keyfields
- type PublicKey
- type SecretKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncryptSecretKey ¶
func EncryptSecretKey(rand io.Reader, skw io.Writer, sk *SecretKey, passphrase []byte, kdfp *Argon2idParams, kf Keyfields) error
EncryptSecretKey writes the secret key encrypted in keyfile format to skw.
func GenerateKeys ¶
func GenerateKeys(rand io.Reader, pkw, skw io.Writer, passphrase []byte, kdfp *Argon2idParams, comment string) (fingerprint string, err error)
GenerateKeys generates a random Streamlined NTRU Prime 4591^761 public/secret key pair, writing the public key to pkw and secret key to skw. The secret key is encrypted with ChaCha20-Poly1305 using a symmetric key derived using Argon2id from passphrase and specified KDF parameters. Cryptographically-secure randomness is provided by rand.
Types ¶
type Argon2idParams ¶
Argon2idParams describes the difficulty parameters used when deriving a symmetric encryption key from a passphrase using the Argon2id KDF.
type Keyfields ¶
Keyfields describes keyfile fields that must be preserved when a key is reencrypted.
type PublicKey ¶
type PublicKey = [ntrup.PublicKeySize]byte
PublicKey is a type alias for a properly-sized byte array to represent a Streamlined NTRU Prime 4591^761 public key.
type SecretKey ¶
type SecretKey = [ntrup.PrivateKeySize]byte
SecretKey is a type alias for a properly-sized byte array to represent a Streamlined NTRU Prime 4591^761 secret key.