ISARA Radiate Key State Manager
Version 1.2
A framework for safe storage of LMS private key state.
|
#include <ikm_io.h>
Data Fields | |
ikm_retval(* | initialize )(const void *user_ctx, void **io_ctx) |
ikm_retval(* | cleanup )(void **io_ctx) |
ikm_retval(* | get_size )(void *io_ctx, uint32_t obj_id, size_t *size) |
ikm_retval(* | read )(void *io_ctx, uint32_t obj_id, uint8_t *data, size_t data_size) |
ikm_retval(* | write )(void *io_ctx, uint32_t obj_id, const uint8_t *data, size_t data_size) |
ikm_retval(* | remove )(void *io_ctx, uint32_t obj_id) |
ikm_retval(* cleanup) (void **io_ctx) |
Clean up the IO Context.
Perform any clean up required before the IO Context is destroyed, including closing any connections.
[in,out] | io_ctx | IO context created during initialize() . |
IKM_OK
or a suitable error value. ikm_retval(* get_size) (void *io_ctx, uint32_t obj_id, size_t *size) |
Get the size of the key, in bytes, from storage
[in] | io_ctx | A pointer to an IO context. |
[in] | obj_id | Key object identifier. |
[out] | size | Size of storage unit, in bytes. |
IKM_OK
on success, or a value from ikm_retval.h when an error occurs. ikm_retval(* initialize) (const void *user_ctx, void **io_ctx) |
Initialize the Input/Output Context.
Called to initialize the IO context with the given descriptor.
user_ctx could be used to provide the information that is needed to perform a one time initialization before IO operations, for example opening a connection to a database, or providing an address to the container where all the data is stored.
[in] | user_ctx | Contextual data passed in by the user. |
[in] | io_ctx | An object representing state data for IO operations. |
IKM_OK
or a suitable error value. ikm_retval(* read) (void *io_ctx, uint32_t obj_id, uint8_t *data, size_t data_size) |
Read data from a stored key object.
[in] | io_ctx | A pointer to an IO context. |
[in] | obj_id | Key object identifier. |
[out] | data | A buffer to receive the read bytes. |
[in] | data_size | Size of the data, in bytes. |
IKM_OK
on success, or a value from ikm_retval.h when an error occurs. ikm_retval(* remove) (void *io_ctx, uint32_t obj_id) |
Remove a stored key object.
Called to permanently remove the data that is identified with obj_id, from storage.
[in] | io_ctx | A pointer to an IO context. |
[in] | obj_id | Key object identifier. |
IKM_OK
on success, or a value from ikm_retval.h when an error occurs. ikm_retval(* write) (void *io_ctx, uint32_t obj_id, const uint8_t *data, size_t data_size) |
Write data associated with the key object to storage.
[in] | io_ctx | A pointer to an IO context. |
[in] | obj_id | Key object identifier. |
[in] | data | A buffer to receive the read bytes. |
[in] | data_size | Size of the data, in bytes. |
IKM_OK
on success, or a value from ikm_retval.h when an error occurs. Callbacks for IO implementations.
These callbacks are mainly used with the ISARA Radiate Key State Manager. After an IO context is created, these callbacks are used to store/retrieve/delete cryptographic keys. IO callback implementors are responsible for associating the key data with the provided object identifier (obj_id), so that data could be retrieved in its entirety using the same obj_id.