diff options
Diffstat (limited to 'include/private/apr_crypto_internal.h')
-rw-r--r-- | include/private/apr_crypto_internal.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index 5da92e558879..1ea838bfb7d1 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -59,7 +59,7 @@ struct apr_crypto_driver_t { /** * @brief Get a hash table of key types, keyed by the name of the type against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_type_t. * * @param types - hashtable of key types keyed to constants. * @param f - encryption context @@ -70,7 +70,7 @@ struct apr_crypto_driver_t { /** * @brief Get a hash table of key modes, keyed by the name of the mode against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_mode_t. * * @param modes - hashtable of key modes keyed to constants. * @param f - encryption context @@ -267,6 +267,25 @@ struct apr_crypto_driver_t { */ apr_status_t (*error)(const apu_err_t **result, const apr_crypto_t *f); + /** + * @brief Create a key from the provided secret or passphrase. The key is cleaned + * up when the context is cleaned, and may be reused with multiple encryption + * or decryption operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param key The key returned, see note. + * @param rec The key record, from which the key will be derived. + * @param f The context to use. + * @param p The pool to use. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ + apr_status_t (*key)(apr_crypto_key_t **key, const apr_crypto_key_rec_t *rec, + const apr_crypto_t *f, apr_pool_t *p); + }; #endif |