17 #ifndef __KEYS_CONFIG_MANAGER_H__ 18 #define __KEYS_CONFIG_MANAGER_H__ 81 size_t kcm_item_name_len,
83 bool kcm_item_is_factory,
84 const uint8_t *kcm_item_data,
85 size_t kcm_item_data_size,
105 size_t kcm_item_name_len,
107 size_t *kcm_item_data_size_out);
126 size_t kcm_item_name_len,
128 uint8_t *kcm_item_data_out,
129 size_t kcm_item_data_max_size,
130 size_t *kcm_item_data_act_size_out);
150 size_t kcm_item_name_len,
152 uint8_t ** kcm_item_data_out,
153 size_t * kcm_item_data_size_out);
155 #ifdef MBED_CONF_MBED_CLOUD_CLIENT_PSA_SUPPORT 177 kcm_status_e kcm_item_get_handle(
const uint8_t *kcm_item_name,
178 size_t kcm_item_name_len,
193 #ifdef MBED_CONF_MBED_CLOUD_CLIENT_SECURE_ELEMENT_SUPPORT 198 #define KCM_ITEM_EXTRA_INFO_INIT {KCM_LOCATION_PSA, KCM_LOCATION_PSA} 199 static inline kcm_item_extra_info_s kcm_item_extra_info_init(
void)
201 const kcm_item_extra_info_s extra_info = KCM_ITEM_EXTRA_INFO_INIT;
222 kcm_status_e kcm_item_get_location(
const uint8_t *item_name,
223 size_t item_name_len,
225 kcm_item_location_e *item_location_out);
227 #endif // #ifdef MBED_CONF_MBED_CLOUD_CLIENT_SECURE_ELEMENT_SUPPORT 228 #endif // #ifdef MBED_CONF_MBED_CLOUD_CLIENT_PSA_SUPPORT 243 size_t kcm_item_name_len,
262 const uint8_t *kcm_chain_name,
263 size_t kcm_chain_name_len,
264 size_t kcm_chain_len,
265 bool kcm_chain_is_factory);
289 const uint8_t *kcm_chain_name,
290 size_t kcm_chain_name_len,
291 size_t *kcm_chain_len_out);
310 const uint8_t *kcm_cert_data,
311 size_t kcm_cert_data_size);
324 size_t kcm_chain_name_len);
340 size_t *kcm_cert_data_size);
358 uint8_t *kcm_cert_data,
359 size_t kcm_max_cert_data_size,
360 size_t *kcm_actual_cert_data_size);
414 const uint8_t *private_key_name,
415 size_t private_key_name_len,
416 const uint8_t *public_key_name,
417 size_t public_key_name_len,
418 bool kcm_item_is_factory,
437 size_t private_key_name_len,
439 uint8_t *csr_buff_out,
440 size_t csr_buff_max_size,
441 size_t *csr_buff_act_size);
471 const uint8_t *private_key_name,
472 size_t private_key_name_len,
473 const uint8_t *public_key_name,
474 size_t public_key_name_len,
475 bool kcm_item_is_factory,
477 uint8_t *csr_buff_out,
478 size_t csr_buff_max_size,
479 size_t *csr_buff_act_size_out,
499 size_t kcm_cert_data_size,
500 const uint8_t *kcm_priv_key_name,
501 size_t kcm_priv_key_name_len);
527 const uint8_t *private_key_name,
528 size_t private_key_name_len,
529 const uint8_t *hash_digest,
530 size_t hash_digest_size,
531 uint8_t *signature_data_out,
532 size_t signature_data_max_size,
533 size_t *signature_data_act_size_out);
559 const uint8_t *public_key_name,
560 size_t public_key_name_len,
561 const uint8_t *hash_digest,
562 size_t hash_digest_size,
563 const uint8_t *signature,
564 size_t signature_size);
601 const uint8_t *private_key_name,
602 size_t private_key_name_len,
603 const uint8_t *peer_public_key,
604 size_t peer_public_key_size,
605 uint8_t *shared_secret,
606 size_t shared_secret_max_size,
607 size_t *shared_secret_act_size_out);
613 #endif //__KEYS_CONFIG_MANAGER_H__ kcm_crypto_key_scheme_e
Definition: kcm_defs.h:74
kcm_status_e kcm_cert_chain_close(kcm_cert_chain_handle kcm_chain_handle)
kcm_status_e kcm_asymmetric_sign(const uint8_t *private_key_name, size_t private_key_name_len, const uint8_t *hash_digest, size_t hash_digest_size, uint8_t *signature_data_out, size_t signature_data_max_size, size_t *signature_data_act_size_out)
Keys and configuration manager (KCM) status/error codes. This list may grow as needed.
kcm_status_e kcm_csr_generate(const uint8_t *private_key_name, size_t private_key_name_len, const kcm_csr_params_s *csr_params, uint8_t *csr_buff_out, size_t csr_buff_max_size, size_t *csr_buff_act_size)
kcm_status_e kcm_cert_chain_add_next(kcm_cert_chain_handle kcm_chain_handle, const uint8_t *kcm_cert_data, size_t kcm_cert_data_size)
kcm_status_e kcm_cert_chain_open(kcm_cert_chain_handle *kcm_chain_handle, const uint8_t *kcm_chain_name, size_t kcm_chain_name_len, size_t *kcm_chain_len_out)
uintptr_t kcm_key_handle_t
Definition: kcm_defs.h:88
kcm_status_e kcm_item_delete(const uint8_t *kcm_item_name, size_t kcm_item_name_len, kcm_item_type_e kcm_item_type)
kcm_status_e kcm_finalize(void)
kcm_status_e kcm_item_get_size_and_data(const uint8_t *kcm_item_name, size_t kcm_item_name_len, kcm_item_type_e kcm_item_type, uint8_t **kcm_item_data_out, size_t *kcm_item_data_size_out)
void * kcm_security_desc_s
Definition: kcm_defs.h:94
Definition: kcm_defs.h:104
kcm_status_e kcm_generate_random(uint8_t *buffer, size_t buffer_size)
kcm_status_e kcm_item_get_data(const uint8_t *kcm_item_name, size_t kcm_item_name_len, kcm_item_type_e kcm_item_type, uint8_t *kcm_item_data_out, size_t kcm_item_data_max_size, size_t *kcm_item_data_act_size_out)
kcm_status_e kcm_cert_chain_get_next_size(kcm_cert_chain_handle kcm_chain_handle, size_t *kcm_cert_data_size)
kcm_item_type_e
Definition: kcm_defs.h:34
kcm_status_e kcm_factory_reset(void)
kcm_status_e kcm_item_get_data_size(const uint8_t *kcm_item_name, size_t kcm_item_name_len, kcm_item_type_e kcm_item_type, size_t *kcm_item_data_size_out)
Keys and configuration manager (KCM) definitions.
kcm_status_e kcm_item_store(const uint8_t *kcm_item_name, size_t kcm_item_name_len, kcm_item_type_e kcm_item_type, bool kcm_item_is_factory, const uint8_t *kcm_item_data, size_t kcm_item_data_size, const kcm_security_desc_s kcm_item_info)
kcm_status_e kcm_asymmetric_verify(const uint8_t *public_key_name, size_t public_key_name_len, const uint8_t *hash_digest, size_t hash_digest_size, const uint8_t *signature, size_t signature_size)
kcm_status_e
Definition: kcm_status.h:30
kcm_status_e kcm_cert_chain_delete(const uint8_t *kcm_chain_name, size_t kcm_chain_name_len)
kcm_status_e kcm_cert_chain_create(kcm_cert_chain_handle *kcm_chain_handle, const uint8_t *kcm_chain_name, size_t kcm_chain_name_len, size_t kcm_chain_len, bool kcm_chain_is_factory)
kcm_status_e kcm_generate_keys_and_csr(kcm_crypto_key_scheme_e key_scheme, const uint8_t *private_key_name, size_t private_key_name_len, const uint8_t *public_key_name, size_t public_key_name_len, bool kcm_item_is_factory, const kcm_csr_params_s *csr_params, uint8_t *csr_buff_out, size_t csr_buff_max_size, size_t *csr_buff_act_size_out, const kcm_security_desc_s kcm_item_info)
kcm_status_e kcm_init(void)
kcm_status_e kcm_cert_chain_get_next_data(kcm_cert_chain_handle kcm_chain_handle, uint8_t *kcm_cert_data, size_t kcm_max_cert_data_size, size_t *kcm_actual_cert_data_size)
kcm_status_e kcm_certificate_verify_with_private_key(const uint8_t *kcm_cert_data, size_t kcm_cert_data_size, const uint8_t *kcm_priv_key_name, size_t kcm_priv_key_name_len)
kcm_status_e kcm_key_pair_generate_and_store(const kcm_crypto_key_scheme_e key_scheme, const uint8_t *private_key_name, size_t private_key_name_len, const uint8_t *public_key_name, size_t public_key_name_len, bool kcm_item_is_factory, const kcm_security_desc_s kcm_item_info)