aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/pkcs8.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey/pkcs8.h')
-rw-r--r--src/pubkey/pkcs8.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/pubkey/pkcs8.h b/src/pubkey/pkcs8.h
index 00607b329..d573fb460 100644
--- a/src/pubkey/pkcs8.h
+++ b/src/pubkey/pkcs8.h
@@ -9,7 +9,7 @@
#define BOTAN_PKCS8_H__
#include <botan/x509_key.h>
-#include <botan/ui.h>
+#include <functional>
namespace Botan {
@@ -123,18 +123,19 @@ inline void encrypt_key(const Private_Key& key,
* Load a key from a data source.
* @param source the data source providing the encoded key
* @param rng the rng to use
-* @param ui the user interface to be used for passphrase dialog
+* @param get_passphrase a function that returns passphrases
* @return loaded private key object
*/
-BOTAN_DLL Private_Key* load_key(DataSource& source,
- RandomNumberGenerator& rng,
- const User_Interface& ui);
+BOTAN_DLL Private_Key* load_key(
+ DataSource& source,
+ RandomNumberGenerator& rng,
+ std::function<std::pair<bool, std::string> ()> get_passphrase);
/** Load a key from a data source.
* @param source the data source providing the encoded key
* @param rng the rng to use
* @param pass the passphrase to decrypt the key. Provide an empty
-* string if the key is not encoded.
+* string if the key is not encrypted
* @return loaded private key object
*/
BOTAN_DLL Private_Key* load_key(DataSource& source,
@@ -145,18 +146,19 @@ BOTAN_DLL Private_Key* load_key(DataSource& source,
* Load a key from a file.
* @param filename the path to the file containing the encoded key
* @param rng the rng to use
-* @param ui the user interface to be used for passphrase dialog
+* @param get_passphrase a function that returns passphrases
* @return loaded private key object
*/
-BOTAN_DLL Private_Key* load_key(const std::string& filename,
- RandomNumberGenerator& rng,
- const User_Interface& ui);
+BOTAN_DLL Private_Key* load_key(
+ const std::string& filename,
+ RandomNumberGenerator& rng,
+ std::function<std::pair<bool, std::string> ()> get_passphrase);
/** Load a key from a file.
* @param filename the path to the file containing the encoded key
* @param rng the rng to use
* @param pass the passphrase to decrypt the key. Provide an empty
-* string if the key is not encoded.
+* string if the key is not encrypted
* @return loaded private key object
*/
BOTAN_DLL Private_Key* load_key(const std::string& filename,