Represents a X25519 private key with associated salt.
More...
#include <encryption.hpp>
|
enum | { key_size = 32
, salt_size = 32
} |
| Size in octets of key an salt.
|
|
enum | { min_iterations = 100000
} |
|
|
| operator bool () const |
|
std::vector< uint8_t > const & | salt () const |
|
public_key | pubkey () const |
| Calculates the public key corresponding to the private key.
|
|
std::vector< uint8_t > | shared_secret (public_key const &pub) const |
| Calculates a shared secret using Elliptic Curve Diffie-Hellman on Curve25519 (X25519)
|
|
std::string | to_base64 (bool pad=true) const |
|
|
static private_key | generate () |
| Generates a random private key.
|
|
static private_key | from_password (std::vector< uint8_t > const &password, std::vector< uint8_t > const &salt, unsigned int iterations=min_iterations) |
| Derives a symmetric key using PBKDF2-SHA256 from the given password and salt. More...
|
|
static private_key | from_password (std::string_view const &password, std::vector< uint8_t > const &salt, unsigned int iterations=min_iterations) |
|
static private_key | from_base64 (std::string_view const &base64) |
|
Represents a X25519 private key with associated salt.
- See also
- public_key
◆ from_password()
static private_key from_password |
( |
std::vector< uint8_t > const & |
password, |
|
|
std::vector< uint8_t > const & |
salt, |
|
|
unsigned int |
iterations = min_iterations |
|
) |
| |
|
static |
Derives a symmetric key using PBKDF2-SHA256 from the given password and salt.
- Parameters
-
iterations | cannot be smaller than min_iterations |
The documentation for this class was generated from the following file: