8 #ifndef BOTAN_PKCS8_H__
9 #define BOTAN_PKCS8_H__
11 #include <botan/x509_key.h>
36 BOTAN_DLL secure_vector<uint8_t>
BER_encode(
const Private_Key& key);
43 BOTAN_DLL std::string
PEM_encode(
const Private_Key& key);
56 BOTAN_DLL std::vector<uint8_t>
58 RandomNumberGenerator& rng,
59 const std::string& pass,
60 std::chrono::milliseconds msec = std::chrono::milliseconds(300),
61 const std::string& pbe_algo =
"");
77 RandomNumberGenerator& rng,
78 const std::string& pass,
79 std::chrono::milliseconds msec = std::chrono::milliseconds(300),
80 const std::string& pbe_algo =
"");
95 BOTAN_DLL std::vector<uint8_t>
97 RandomNumberGenerator& rng,
98 const std::string& pass,
100 const std::string& cipher =
"",
101 const std::string& pbkdf_hash =
"");
117 BOTAN_DLL std::string
119 RandomNumberGenerator& rng,
120 const std::string& pass,
122 const std::string& cipher =
"",
123 const std::string& pbkdf_hash =
"");
139 BOTAN_DLL std::vector<uint8_t>
141 RandomNumberGenerator& rng,
142 const std::string& pass,
143 std::chrono::milliseconds pbkdf_msec,
144 size_t* pbkdf_iterations,
145 const std::string& cipher =
"",
146 const std::string& pbkdf_hash =
"");
164 BOTAN_DLL std::string
166 RandomNumberGenerator& rng,
167 const std::string& pass,
168 std::chrono::milliseconds pbkdf_msec,
169 size_t* pbkdf_iterations,
170 const std::string& cipher =
"",
171 const std::string& pbkdf_hash =
"");
180 BOTAN_DLL Private_Key*
load_key(DataSource& source,
181 RandomNumberGenerator& rng,
182 std::function<std::string ()> get_passphrase);
190 BOTAN_DLL Private_Key*
load_key(DataSource& source,
191 RandomNumberGenerator& rng,
192 const std::string& pass);
199 BOTAN_DLL Private_Key*
load_key(DataSource& source,
200 RandomNumberGenerator& rng);
202 #if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
210 BOTAN_DLL Private_Key*
load_key(
const std::string& filename,
211 RandomNumberGenerator& rng,
212 std::function<std::string ()> get_passphrase);
220 BOTAN_DLL Private_Key*
load_key(
const std::string& filename,
221 RandomNumberGenerator& rng,
222 const std::string& pass);
229 BOTAN_DLL Private_Key*
load_key(
const std::string& filename,
230 RandomNumberGenerator& rng);
239 BOTAN_DLL Private_Key*
copy_key(
const Private_Key& key,
240 RandomNumberGenerator& rng);
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)
secure_vector< uint8_t > BER_encode(const Private_Key &key)
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::string PEM_encode(const Private_Key &key)
Private_Key * load_key(DataSource &source, RandomNumberGenerator &rng, std::function< std::string()> get_pass)
Private_Key * copy_key(const Private_Key &key, RandomNumberGenerator &rng)
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::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)
PKCS8_Exception(const std::string &error)