|
OPTIGA™ Trust M
Host Library Documentation
|
Go to the documentation of this file.
39 #ifndef _OPTIGA_UTIL_H_
40 #define _OPTIGA_UTIL_H_
49 #define OPTIGA_UTIL_WRITE_ONLY (0x00)
50 #define OPTIGA_UTIL_ERASE_AND_WRITE (0x40)
55 #define OPTIGA_UTIL_CONTEXT_NONE (0x00)
81 #ifdef OPTIGA_COMMS_SHIELDED_CONNECTION
82 uint8_t protection_level;
85 uint8_t protocol_version;
86 #endif //OPTIGA_COMMS_SHIELDED_CONNECTION
92 #ifdef OPTIGA_COMMS_SHIELDED_CONNECTION
120 uint8_t parameter_type,
252 bool_t perform_hibernate);
370 const uint8_t * buffer,
406 const uint8_t * buffer,
444 uint8_t manifest_version,
446 uint16_t manifest_length);
482 const uint8_t * fragment,
483 uint16_t fragment_length);
517 const uint8_t * fragment,
518 uint16_t fragment_length);
550 uint16_t optiga_counter_oid,
578 #ifdef OPTIGA_COMMS_SHIELDED_CONNECTION
579 #define OPTIGA_UTIL_SET_COMMS_PROTECTION_LEVEL(p_instance, protection_level) \
581 optiga_util_set_comms_params(p_instance, \
582 OPTIGA_COMMS_PROTECTION_LEVEL, \
586 #define OPTIGA_UTIL_SET_COMMS_PROTECTION_LEVEL(p_instance, protection_level) {}
605 #ifdef OPTIGA_COMMS_SHIELDED_CONNECTION
606 #define OPTIGA_UTIL_SET_COMMS_PROTOCOL_VERSION(p_instance, version) \
608 optiga_util_set_comms_params(p_instance, \
609 OPTIGA_COMMS_PROTOCOL_VERSION, \
613 #define OPTIGA_UTIL_SET_COMMS_PROTOCOL_VERSION(p_instance, version) {}
struct optiga_cmd optiga_cmd_t
OPTIGA command instance structure type.
union optiga_util_params optiga_util_params_t
union for OPTIGA util parameters
LIBRARY_EXPORTS optiga_lib_status_t optiga_util_protected_update_start(optiga_util_t *me, uint8_t manifest_version, const uint8_t *manifest, uint16_t manifest_length)
Initiates the start of protected update of object by writing manifest into OPTIGA object.
LIBRARY_EXPORTS optiga_lib_status_t optiga_util_protected_update_continue(optiga_util_t *me, const uint8_t *fragment, uint16_t fragment_length)
Sends fragment(s) of data to be written to OPTIGA.
Specifies the data structure for data to be written to OPTIGA.
LIBRARY_EXPORTS optiga_lib_status_t optiga_util_close_application(optiga_util_t *me, bool_t perform_hibernate)
Closes the application on OPTIGA and closes the communication with optiga.
Specifies the data structure for data to be read from OPTIGA.
optiga_cmd_t * my_cmd
pointer to optiga command instance
void * caller_context
Callback context.
LIBRARY_EXPORTS optiga_lib_status_t optiga_util_write_metadata(optiga_util_t *me, uint16_t optiga_oid, const uint8_t *buffer, uint8_t length)
Writes metadata for the user provided data object.
LIBRARY_EXPORTS optiga_lib_status_t optiga_util_write_data(optiga_util_t *me, uint16_t optiga_oid, uint8_t write_type, uint16_t offset, const uint8_t *buffer, uint16_t length)
Writes data to optiga.
LIBRARY_EXPORTS optiga_lib_status_t optiga_util_update_count(optiga_util_t *me, uint16_t optiga_counter_oid, uint8_t count)
Increments the counter object by a value specified by user.
OPTIGA util instance structure.
union for OPTIGA util parameters
LIBRARY_EXPORTS optiga_lib_status_t optiga_util_protected_update_final(optiga_util_t *me, const uint8_t *fragment, uint16_t fragment_length)
Sends the last fragment to finalize the protected update of data object.
uint16_t instance_state
To provide the busy/free status of the util instance.
LIBRARY_EXPORTS optiga_lib_status_t optiga_util_read_metadata(optiga_util_t *me, uint16_t optiga_oid, uint8_t *buffer, uint16_t *length)
Reads metadata of the specified data object from optiga.
optiga_set_object_protected_params_t optiga_set_object_protected_params
optiga_get_data_object_params_t optiga_get_data_object_params
LIBRARY_EXPORTS optiga_lib_status_t optiga_util_destroy(optiga_util_t *me)
De-Initializes the OPTIGA util instance.
optiga_set_data_object_params_t optiga_set_data_object_params
uint8_t bool_t
Typedef for a boolean.
Specifies the data structure for protected update.
LIBRARY_EXPORTS optiga_lib_status_t optiga_util_open_application(optiga_util_t *me, bool_t perform_restore)
Initializes the communication with optiga and open the application on OPTIGA.
This file defines APIs, types and data structures used in the Command (cmd) module implementation.
void(* callback_handler_t)(void *callback_ctx, optiga_lib_status_t event)
typedef for event callback handler
optiga_util_params_t params
Details/references (pointers) to the Application Inputs.
callback_handler_t handler
Callback handler.
uint16_t optiga_lib_status_t
typedef for OPTIGA host library status
LIBRARY_EXPORTS optiga_util_t * optiga_util_create(uint8_t optiga_instance_id, callback_handler_t handler, void *caller_context)
Create an instance of optiga_util_t.
LIBRARY_EXPORTS optiga_lib_status_t optiga_util_read_data(optiga_util_t *me, uint16_t optiga_oid, uint16_t offset, uint8_t *buffer, uint16_t *length)
Reads data from optiga.