11#include <botan/pk_keys.h>
12#include <botan/exceptn.h>
13#include <botan/secmem.h>
14#include <botan/data_src.h>
21class RandomNumberGenerator;
69 const
std::
string& pass,
70 std::chrono::milliseconds msec =
std::chrono::milliseconds(300),
71 const
std::
string& pbe_algo = "");
88 const
std::
string& pass,
89 std::chrono::milliseconds msec =
std::chrono::milliseconds(300),
90 const
std::
string& pbe_algo = "");
108 const
std::
string& pass,
110 const
std::
string& cipher = "",
111 const
std::
string& pbkdf_hash = "");
130 const
std::
string& pass,
132 const
std::
string& cipher = "",
133 const
std::
string& pbkdf_hash = "");
152 const
std::
string& pass,
153 std::chrono::milliseconds pbkdf_msec,
154 size_t* pbkdf_iterations,
155 const
std::
string& cipher = "",
156 const
std::
string& pbkdf_hash = "");
177 const
std::
string& pass,
178 std::chrono::milliseconds pbkdf_msec,
179 size_t* pbkdf_iterations,
180 const
std::
string& cipher = "",
181 const
std::
string& pbkdf_hash = "");
191 const
std::function<
std::
string ()>& get_passphrase);
200 const
std::
string& pass);
229BOTAN_DEPRECATED(
"Use version that doesn't take an RNG")
232 std::function<
std::
string ()> get_passphrase)
244BOTAN_DEPRECATED(
"Use version that doesn't take an RNG")
247 const
std::
string& pass)
258BOTAN_DEPRECATED(
"Use version that doesn't take an RNG")
266#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
274BOTAN_DEPRECATED(
"Use DataSource_Stream and another load_key variant")
277 std::function<
std::
string ()> get_passphrase)
290BOTAN_DEPRECATED(
"Use DataSource_Stream and another load_key variant")
291inline Private_Key*
load_key(const
std::
string& filename,
292 RandomNumberGenerator& rng,
293 const
std::
string& pass)
296 DataSource_Stream in(filename);
299 return PKCS8::load_key(in, std::bind([](
const std::string p) {
return p; }, pass)).release();
307BOTAN_DEPRECATED(
"Use DataSource_Stream and another load_key variant")
308inline Private_Key*
load_key(const
std::
string& filename,
309 RandomNumberGenerator& rng)
312 DataSource_Stream in(filename);
323BOTAN_DEPRECATED(
"Use version that doesn't take an RNG")
#define BOTAN_UNUSED(...)
PKCS8_Exception(const std::string &error)
secure_vector< uint8_t > private_key_info() const
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
std::unique_ptr< Private_Key > copy_key(const Private_Key &key)
std::vector< uint8_t > BER_encode_encrypted_pbkdf_iter(const Private_Key &key, RandomNumberGenerator &rng, const std::string &pass, size_t pbkdf_iterations, const std::string &cipher, const std::string &pbkdf_hash)
std::string PEM_encode(const Private_Key &key)
std::string PEM_encode_encrypted_pbkdf_msec(const Private_Key &key, RandomNumberGenerator &rng, const std::string &pass, std::chrono::milliseconds pbkdf_msec, size_t *pbkdf_iterations, const std::string &cipher, const std::string &pbkdf_hash)
std::vector< uint8_t > BER_encode(const Private_Key &key, RandomNumberGenerator &rng, const std::string &pass, std::chrono::milliseconds msec, const std::string &pbe_algo)
std::vector< uint8_t > BER_encode_encrypted_pbkdf_msec(const Private_Key &key, RandomNumberGenerator &rng, const std::string &pass, std::chrono::milliseconds pbkdf_msec, size_t *pbkdf_iterations, const std::string &cipher, const std::string &pbkdf_hash)
std::unique_ptr< Private_Key > load_key(DataSource &source, const std::function< std::string()> &get_pass)
std::string PEM_encode_encrypted_pbkdf_iter(const Private_Key &key, RandomNumberGenerator &rng, const std::string &pass, size_t pbkdf_iterations, const std::string &cipher, const std::string &pbkdf_hash)
std::vector< T, secure_allocator< T > > secure_vector