summaryrefslogtreecommitdiff
path: root/crypto/apr_crypto.c
diff options
context:
space:
mode:
authorminfrin <minfrin@13f79535-47bb-0310-9956-ffa450edef68>2011-05-30 23:30:24 +0000
committerminfrin <minfrin@13f79535-47bb-0310-9956-ffa450edef68>2011-05-30 23:30:24 +0000
commit809e010f75c2e10a8da4cfa7ef9b2920402ca6df (patch)
tree93b3f69c4d1ea7e2ed88d56bbbb792b70098365f /crypto/apr_crypto.c
parentb9b93e4604a5ffc64bec3dead921467c73ae9b43 (diff)
downloadlibapr-809e010f75c2e10a8da4cfa7ef9b2920402ca6df.tar.gz
apr_crypto: Add apr_crypto_get_block_key_types() and
apr_crypto_get_block_key_modes() to provide a way to programmatically query what key types and modes are supported by a provider, either per mode/type, or by iterating through a hashtable. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1129433 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'crypto/apr_crypto.c')
-rw-r--r--crypto/apr_crypto.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c
index 89ab566c8..9162e52ba 100644
--- a/crypto/apr_crypto.c
+++ b/crypto/apr_crypto.c
@@ -235,6 +235,34 @@ APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, const apr_crypto_dri
}
/**
+ * @brief Get a hash table of key types, keyed by the name of the type against
+ * an integer pointer constant.
+ *
+ * @param types - hashtable of key types keyed to constants.
+ * @param f - encryption context
+ * @return APR_SUCCESS for success
+ */
+APR_DECLARE(apr_status_t) apr_crypto_get_block_key_types(apr_hash_t **types,
+ const apr_crypto_t *f)
+{
+ return f->provider->get_block_key_types(types, f);
+}
+
+/**
+ * @brief Get a hash table of key modes, keyed by the name of the mode against
+ * an integer pointer constant.
+ *
+ * @param modes - hashtable of key modes keyed to constants.
+ * @param f - encryption context
+ * @return APR_SUCCESS for success
+ */
+APR_DECLARE(apr_status_t) apr_crypto_get_block_key_modes(apr_hash_t **modes,
+ const apr_crypto_t *f)
+{
+ return f->provider->get_block_key_modes(modes, f);
+}
+
+/**
* @brief Create a key from the given passphrase. By default, the PBKDF2
* algorithm is used to generate the key from the passphrase. It is expected
* that the same pass phrase will generate the same key, regardless of the