ISARA Radiate Key State Manager  Version 1.2
A framework for safe storage of LMS private key state.
ikm_IOCallbacks Struct Reference

#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)
 

Field Documentation

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.

Parameters
[in,out]io_ctxIO context created during initialize().
Returns
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

Parameters
[in]io_ctxA pointer to an IO context.
[in]obj_idKey object identifier.
[out]sizeSize of storage unit, in bytes.
Returns
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.

Parameters
[in]user_ctxContextual data passed in by the user.
[in]io_ctxAn object representing state data for IO operations.
Returns
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.

Parameters
[in]io_ctxA pointer to an IO context.
[in]obj_idKey object identifier.
[out]dataA buffer to receive the read bytes.
[in]data_sizeSize of the data, in bytes.
Returns
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.

Parameters
[in]io_ctxA pointer to an IO context.
[in]obj_idKey object identifier.
Returns
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.

Parameters
[in]io_ctxA pointer to an IO context.
[in]obj_idKey object identifier.
[in]dataA buffer to receive the read bytes.
[in]data_sizeSize of the data, in bytes.
Returns
IKM_OK on success, or a value from ikm_retval.h when an error occurs.

Detailed Description

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.