aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi/ffi.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-03-29 10:04:26 -0400
committerJack Lloyd <[email protected]>2017-03-29 10:04:26 -0400
commit8a312886fc3b6286b0bee67ad806ff9047256903 (patch)
tree5312b33d1ad57f0a62015dfb4c7bea5b9dc0c550 /src/lib/ffi/ffi.h
parent484b4ef68120cc34a738837b913c6cfe1be3928e (diff)
parent8bbec86f8984b52b5d0cce8cd1309563d2b294cc (diff)
Merge GH #899 Add ability to specify iterations when encrypting a private key
Diffstat (limited to 'src/lib/ffi/ffi.h')
-rw-r--r--src/lib/ffi/ffi.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/lib/ffi/ffi.h b/src/lib/ffi/ffi.h
index 2cb8d38bd..661368c18 100644
--- a/src/lib/ffi/ffi.h
+++ b/src/lib/ffi/ffi.h
@@ -597,6 +597,7 @@ BOTAN_DLL int botan_privkey_export(botan_privkey_t key,
/*
* Set encryption_algo to NULL or "" to have the library choose a default (recommended)
*/
+BOTAN_DEPRECATED("Use botan_privkey_export_encrypted_pbkdf_{msec,iter}")
BOTAN_DLL int botan_privkey_export_encrypted(botan_privkey_t key,
uint8_t out[], size_t* out_len,
botan_rng_t rng,
@@ -604,6 +605,32 @@ BOTAN_DLL int botan_privkey_export_encrypted(botan_privkey_t key,
const char* encryption_algo,
uint32_t flags);
+/*
+* Export a private key, running PBKDF for specified amount of time
+* @param key the private key to export
+*/
+BOTAN_DLL int botan_privkey_export_encrypted_pbkdf_msec(botan_privkey_t key,
+ uint8_t out[], size_t* out_len,
+ botan_rng_t rng,
+ const char* passphrase,
+ uint32_t pbkdf_msec_runtime,
+ size_t* pbkdf_iterations_out,
+ const char* cipher_algo,
+ const char* pbkdf_algo,
+ uint32_t flags);
+
+/*
+* Export a private key using the specified number of iterations.
+*/
+BOTAN_DLL int botan_privkey_export_encrypted_pbkdf_iter(botan_privkey_t key,
+ uint8_t out[], size_t* out_len,
+ botan_rng_t rng,
+ const char* passphrase,
+ size_t pbkdf_iterations,
+ const char* cipher_algo,
+ const char* pbkdf_algo,
+ uint32_t flags);
+
typedef struct botan_pubkey_struct* botan_pubkey_t;
BOTAN_DLL int botan_pubkey_load(botan_pubkey_t* key, const uint8_t bits[], size_t len);