|
BSL v1.1.1 - 50.g42e5d9b
AMMOS Bundle Protocol Security Library (BSL)
|
The set of callback function pointers which actually implement a key store. More...
#include <bsl/crypto/KeyStore.h>
Collaboration diagram for BSL_KeyStore_Descriptors_t:Data Fields | |
| int(* | new_key )(BSL_Crypto_KeyHandle_t *key_out) |
| Construct a new default empty key, outside of a key store. | |
| BSL_Crypto_KeyHandle_t(* | acquire_key )(BSL_Crypto_KeyHandle_t handle) |
| Acquire a new copy of a handle. | |
| void(* | release_key )(BSL_Crypto_KeyHandle_t handle) |
| Release the use of a handle. | |
| int(* | find_key )(const BSL_Data_t *keyid, BSL_Crypto_KeyHandle_t *handle) |
| Find an identified key in the key store. | |
| int(* | add_key )(const BSL_Data_t *keyid, BSL_Crypto_KeyHandle_t handle) |
| Add a key to the key store. | |
| int(* | set_keymat )(BSL_Crypto_KeyHandle_t handle, const BSL_Data_t *data) |
| Set the (plaintext) key material for a key. | |
| int(* | get_keymat )(BSL_Crypto_KeyHandle_t handle, BSL_Data_t *view) |
| Get the (plaintext) key material for a key. | |
| const BSL_Variant_t *(* | get_parameter )(BSL_Crypto_KeyHandle_t handle, int64_t param_id) |
| Get a specific parameter which may be attached to a key. | |
| BSL_Variant_t *(* | set_parameter )(BSL_Crypto_KeyHandle_t handle, int64_t param_id) |
| Set a key parameter before it is added to the key store. | |
| void(* | update_stats )(BSL_Crypto_KeyHandle_t handle, uint64_t use, uint64_t bytes) |
| Update telemetry counters for a key. | |
| int(* | get_stats )(BSL_Crypto_KeyHandle_t handle, BSL_Crypto_KeyStats_t *stats) |
| Get full counters for a key. | |
The set of callback function pointers which actually implement a key store.
When registering, all of the functions need to be non-NULL.
| BSL_Crypto_KeyHandle_t(* BSL_KeyStore_Descriptors_t::acquire_key) (BSL_Crypto_KeyHandle_t handle) |
Acquire a new copy of a handle.
| [in] | handle | The handle to acquire. If NULL handle this is a do-nothing. |
Referenced by BSL_AuthCtx_Init(), BSL_Cipher_Init(), and BSL_KeyStore_Init().
| int(* BSL_KeyStore_Descriptors_t::add_key) (const BSL_Data_t *keyid, BSL_Crypto_KeyHandle_t handle) |
Add a key to the key store.
| [in] | keyid | A unique-to-the-store identifier for a key. |
| [in] | handle | The non-NULL handle to the key to add. |
Referenced by BSL_Crypto_KeyLoader_LoadCoseKeySet_decode(), BSL_Crypto_KeyLoader_LoadJwkSet(), and BSL_KeyStore_Init().
| int(* BSL_KeyStore_Descriptors_t::find_key) (const BSL_Data_t *keyid, BSL_Crypto_KeyHandle_t *handle) |
Find an identified key in the key store.
Some keys are ephemeral and not registered in the store.
| [in] | keyid | A unique-to-the-store identifier for a key. |
| [out] | handle | If found, will be set non-NULL handle. |
Referenced by BSL_Crypto_GetKeyStatistics(), BSL_Crypto_GetRegistryKey(), and BSL_KeyStore_Init().
| int(* BSL_KeyStore_Descriptors_t::get_keymat) (BSL_Crypto_KeyHandle_t handle, BSL_Data_t *view) |
Get the (plaintext) key material for a key.
| [in] | handle | The handle to the key. |
| [out] | data | Non-null pointer to output struct, which will be set to a view on the data. |
Referenced by BSL_AuthCtx_Init(), BSL_Cipher_Init(), BSL_Crypto_CompareKeys(), BSL_Crypto_KDF(), BSL_Crypto_UnwrapKey(), BSL_Crypto_WrapKey(), and BSL_KeyStore_Init().
| const BSL_Variant_t *(* BSL_KeyStore_Descriptors_t::get_parameter) (BSL_Crypto_KeyHandle_t handle, int64_t param_id) |
Get a specific parameter which may be attached to a key.
| [in] | handle | The handle to the key. |
| param_id | The unique identifier for the parameter. The available parameters will be determined by the key source (e.g. COSE_Key parameters). |
Referenced by BSL_Crypto_GetKeyParameter(), and BSL_KeyStore_Init().
| int(* BSL_KeyStore_Descriptors_t::get_stats) (BSL_Crypto_KeyHandle_t handle, BSL_Crypto_KeyStats_t *stats) |
Get full counters for a key.
Referenced by BSL_Crypto_GetKeyStatistics(), and BSL_KeyStore_Init().
| int(* BSL_KeyStore_Descriptors_t::new_key) (BSL_Crypto_KeyHandle_t *key_out) |
Construct a new default empty key, outside of a key store.
| [out] | key_out | The non-null pointer to set. The handle must be released with release_key when it is done being used. |
Referenced by BSL_Crypto_LoadKey(), BSL_KeyStore_Init(), and MockBPA_KeyStore_Descriptors().
| void(* BSL_KeyStore_Descriptors_t::release_key) (BSL_Crypto_KeyHandle_t handle) |
Release the use of a handle.
When all active handles are released the key should be destroyed.
| [in] | handle | The non-NULL handle to release. |
Referenced by BSL_AuthCtx_Deinit(), BSL_Cipher_Deinit(), BSL_Crypto_ReleaseKeyHandle(), and BSL_KeyStore_Init().
| int(* BSL_KeyStore_Descriptors_t::set_keymat) (BSL_Crypto_KeyHandle_t handle, const BSL_Data_t *data) |
Set the (plaintext) key material for a key.
| [in] | handle | The handle to the key. |
| [in] | data | Non-null pointer to key bytes, which will be copied. |
Referenced by BSL_Crypto_LoadKey(), and BSL_KeyStore_Init().
| BSL_Variant_t *(* BSL_KeyStore_Descriptors_t::set_parameter) (BSL_Crypto_KeyHandle_t handle, int64_t param_id) |
Set a key parameter before it is added to the key store.
| [in] | handle | The handle to the key. |
| param_id | The unique identifier for the parameter. |
Referenced by BSL_Crypto_KeyLoader_LoadCoseKeySet_decode(), and BSL_KeyStore_Init().
| void(* BSL_KeyStore_Descriptors_t::update_stats) (BSL_Crypto_KeyHandle_t handle, uint64_t use, uint64_t bytes) |
Update telemetry counters for a key.
Referenced by BSL_AuthCtx_DigestBuffer(), BSL_AuthCtx_DigestSeq(), BSL_AuthCtx_Init(), BSL_Cipher_AddAadBuffer(), BSL_Cipher_AddAadSeq(), BSL_Cipher_AddSeq(), BSL_Cipher_Init(), BSL_Crypto_KDF(), BSL_Crypto_UnwrapKey(), BSL_Crypto_WrapKey(), and BSL_KeyStore_Init().