Virgil IoT KIT
|
Trust List module. More...
#include <stdint.h>
#include <stdbool.h>
#include <virgil/iot/secmodule/secmodule.h>
#include <virgil/iot/storage_hal/storage_hal.h>
#include <virgil/iot/status_code/status_code.h>
#include <virgil/iot/update/update.h>
#include <virgil/iot/trust_list/tl_structs.h>
Go to the source code of this file.
Functions | |
vs_status_e | vs_tl_init (vs_storage_op_ctx_t *op_ctx, vs_secmodule_impl_t *secmodule, vs_file_ver_info_cb_t ver_info_cb) |
Trust List initialization. More... | |
vs_status_e | vs_tl_deinit (void) |
Trust List destruction. More... | |
vs_status_e | vs_tl_save_part (vs_tl_element_info_t *element_info, const uint8_t *in_data, uint16_t data_sz) |
Trust List element saving. More... | |
vs_status_e | vs_tl_load_part (vs_tl_element_info_t *element_info, uint8_t *out_data, uint16_t buf_sz, uint16_t *out_sz) |
Trust List element loading. More... | |
vs_update_interface_t * | vs_tl_update_ctx (void) |
Update interface for Trust List. More... | |
const vs_update_file_type_t * | vs_tl_update_file_type (void) |
Trust List file type. More... | |
void | vs_tl_header_to_host (const vs_tl_header_t *src_data, vs_tl_header_t *dst_data) |
Convert Trust List header to host. More... | |
void | vs_tl_header_to_net (const vs_tl_header_t *src_data, vs_tl_header_t *dst_data) |
Convert Trust List header to network. More... | |
Trust List module.
This file provides interface for Trust Lists processing.
Trust List contains the list of trusted public keys and signatures. Initial Trust List is obtained by device during provision. After that, it can be upgraded by Update library using FLDT service.
Trust List is maintained by Virgil IoT KIT modules and doesn't need to be processed by user. Nonetheless, there are some places where it needs user's attention :
vs_status_e vs_tl_deinit | ( | void | ) |
Trust List destruction.
Destroys Trust List.
void vs_tl_header_to_host | ( | const vs_tl_header_t * | src_data, |
vs_tl_header_t * | dst_data | ||
) |
Convert Trust List header to host.
Convert Trust List header to the host format.
[in] | src_data | Data source. Must not be NULL. |
[out] | dst_data | Data destination. Must not be NULL. |
void vs_tl_header_to_net | ( | const vs_tl_header_t * | src_data, |
vs_tl_header_t * | dst_data | ||
) |
Convert Trust List header to network.
Convert Trust List header to the network format.
[in] | src_data | Data source. Must not be NULL. |
[out] | dst_data | Data destination. Must not be NULL. |
vs_status_e vs_tl_init | ( | vs_storage_op_ctx_t * | op_ctx, |
vs_secmodule_impl_t * | secmodule, | ||
vs_file_ver_info_cb_t | ver_info_cb | ||
) |
Trust List initialization.
Initializes Trust List.
[in] | op_ctx | Storage context. Must not be NULL. |
[in] | secmodule | Security Module implementation. Must not be NULL. |
vs_status_e vs_tl_load_part | ( | vs_tl_element_info_t * | element_info, |
uint8_t * | out_data, | ||
uint16_t | buf_sz, | ||
uint16_t * | out_sz | ||
) |
Trust List element loading.
Loads Trust List header, footer or data chunk. Element selection is performed by element_info selector.
[in] | element_info | Element selection. Must not be NULL. |
[out] | out_data | Output buffer to store data. Must not be NULL. |
[in] | buf_sz | Buffer size. Must not be zero. |
[out] | out_sz | Pointer to save stored data size. Must not be NULL. |
vs_status_e vs_tl_save_part | ( | vs_tl_element_info_t * | element_info, |
const uint8_t * | in_data, | ||
uint16_t | data_sz | ||
) |
Trust List element saving.
Saves Trust List header, footer or data chunk. Element selection is performed by element_info selector.
[in] | element_info | Element selection. Must not be NULL. |
[in] | in_data | Data to be saved. Must not be NULL. |
[in] | data_sz | Data size. Must not be zero. |
vs_update_interface_t* vs_tl_update_ctx | ( | void | ) |
Update interface for Trust List.
Returns Update context for Trust List.
const vs_update_file_type_t* vs_tl_update_file_type | ( | void | ) |