le_iks_interface.h
Go to the documentation of this file.
21 * The IOT Key Store can be used to store cryptographic keys as well as cryptographic hash digests.29 * Keys are initially created in non-persistent memory only and can be saved to persistent storage39 * portion of the update key should be held securely off target. To ensure freshness and uniqueness41 * le_iks_GetUpdateAuthChallenge() and incorporated into the command. The authentication challenges44 * Private and symmetric key values cannot be read out of the IOT Key Store while public key values73 //--------------------------------------------------------------------------------------------------77 //--------------------------------------------------------------------------------------------------80 //--------------------------------------------------------------------------------------------------83 * Connect the current client thread to the service providing this API. Block until the service is87 * called before any other functions in this API. Normally, ConnectService is automatically called92 //--------------------------------------------------------------------------------------------------98 //--------------------------------------------------------------------------------------------------101 * Try to connect the current client thread to the service providing this API. Return with an error104 * For each thread that wants to use this API, either ConnectService or TryConnectService must be105 * called before any other functions in this API. Normally, ConnectService is automatically called114 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).117 //--------------------------------------------------------------------------------------------------123 //--------------------------------------------------------------------------------------------------127 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants130 //--------------------------------------------------------------------------------------------------137 //--------------------------------------------------------------------------------------------------143 * longer a connection to the service, and the functions in this API can't be used. For details, see148 //--------------------------------------------------------------------------------------------------155 //--------------------------------------------------------------------------------------------------160 //--------------------------------------------------------------------------------------------------163 //--------------------------------------------------------------------------------------------------167 //--------------------------------------------------------------------------------------------------170 //--------------------------------------------------------------------------------------------------178 //--------------------------------------------------------------------------------------------------181 //--------------------------------------------------------------------------------------------------183 * Sets the module ID. This module ID may be used to uniquely identify the module, device or chip187 * An update key can be set to delete the module ID. If the update key is not set then the module198 //--------------------------------------------------------------------------------------------------207 //--------------------------------------------------------------------------------------------------219 //--------------------------------------------------------------------------------------------------228 //--------------------------------------------------------------------------------------------------233 * authCmdPtr must contain a valid delete module ID command. If the command is valid and authentic246 //--------------------------------------------------------------------------------------------------255 //--------------------------------------------------------------------------------------------------263 //--------------------------------------------------------------------------------------------------270 //--------------------------------------------------------------------------------------------------287 //--------------------------------------------------------------------------------------------------296 //--------------------------------------------------------------------------------------------------310 //--------------------------------------------------------------------------------------------------321 //--------------------------------------------------------------------------------------------------330 //--------------------------------------------------------------------------------------------------339 //--------------------------------------------------------------------------------------------------348 //--------------------------------------------------------------------------------------------------357 //--------------------------------------------------------------------------------------------------366 //--------------------------------------------------------------------------------------------------375 //--------------------------------------------------------------------------------------------------385 //--------------------------------------------------------------------------------------------------392 //--------------------------------------------------------------------------------------------------395 * The update key can be used at a later time to perform authenticated updates of the specified key.418 //--------------------------------------------------------------------------------------------------427 //--------------------------------------------------------------------------------------------------431 * If the specified key has an assigned update key then the authCmdPtr must contain a generate key433 * and is signed with the update private key. If the command is valid and authentic then a new key452 //--------------------------------------------------------------------------------------------------463 //--------------------------------------------------------------------------------------------------471 * If the key is a symmetric then the key value must be encrypted with the provisioning key. If the474 * If the specified key does not have an assigned update key then the provPackagePtr is treated as a477 * If the specified key has an assigned update key then the provPackagePtr must also contain a valid490 //--------------------------------------------------------------------------------------------------501 //--------------------------------------------------------------------------------------------------515 //--------------------------------------------------------------------------------------------------522 //--------------------------------------------------------------------------------------------------527 * command and a valid authentication challenge, obtained by le_iks_GetUpdateAuthChallenge(), and is528 * signed with the update private key. If the command is valid and authentic then the key will be546 //--------------------------------------------------------------------------------------------------557 //--------------------------------------------------------------------------------------------------573 //--------------------------------------------------------------------------------------------------584 //--------------------------------------------------------------------------------------------------594 //--------------------------------------------------------------------------------------------------601 //--------------------------------------------------------------------------------------------------607 * Created digests initially only exist in non-persistent memory, call le_iks_SaveDigest() to save616 //--------------------------------------------------------------------------------------------------625 //--------------------------------------------------------------------------------------------------634 //--------------------------------------------------------------------------------------------------643 //--------------------------------------------------------------------------------------------------647 * updates of the specified digest. The same update key may be used for multiple keys and digests.667 //--------------------------------------------------------------------------------------------------676 //--------------------------------------------------------------------------------------------------682 * If the specified digest does not have an assigned update key then the provPackagePtr is treated685 * If the specified digest has an assigned update key then the provPackagePtr must also contain a699 //--------------------------------------------------------------------------------------------------710 //--------------------------------------------------------------------------------------------------724 //--------------------------------------------------------------------------------------------------731 //--------------------------------------------------------------------------------------------------736 * digest command and a valid authentication challenge, obtained by le_iks_GetUpdateAuthChallenge()737 * and is signed with the update private key. If the command is valid and authentic then the digest751 //--------------------------------------------------------------------------------------------------762 //--------------------------------------------------------------------------------------------------773 //--------------------------------------------------------------------------------------------------784 //--------------------------------------------------------------------------------------------------788 * This challenge code must be included in any update commands created using the specified update797 //--------------------------------------------------------------------------------------------------809 //--------------------------------------------------------------------------------------------------811 * Get the provisioning key. This is a public key that is internally generated by the IOT Key Store812 * and used to encrypt symmetric and private keys for provisioning into the IOT Key Store. This key825 //--------------------------------------------------------------------------------------------------834 //--------------------------------------------------------------------------------------------------842 //--------------------------------------------------------------------------------------------------849 //--------------------------------------------------------------------------------------------------858 //--------------------------------------------------------------------------------------------------le_result_t le_iks_GetDigestSize(uint64_t digestRef, uint32_t *digestSizePtr)uint64_t le_iks_CreateKeyByType(const char *LE_NONNULL keyId, le_iks_KeyType_t keyType, uint32_t keySize)le_result_t le_iks_GetKeyType(uint64_t keyRef, le_iks_KeyType_t *keyTypePtr)le_result_t le_iks_SaveKey(uint64_t keyRef)le_result_t le_iks_ProvisionDigest(uint64_t digestRef, const uint8_t *provPackagePtr, size_t provPackageSize)le_result_t le_iks_GetDigestValue(uint64_t digestRef, uint8_t *bufPtr, size_t *bufSizePtr)le_result_t le_iks_DeleteModuleId(const uint8_t *authCmdPtr, size_t authCmdSize)LE_FULL_API void le_iks_SetServerDisconnectHandler(le_iks_DisconnectHandler_t disconnectHandler, void *contextPtr)le_result_t le_iks_DeleteSession(uint64_t sessionRef)uint64_t le_iks_GetKey(const char *LE_NONNULL keyId)le_result_t le_iks_SetKeyUpdateKey(uint64_t keyRef, uint64_t updateKeyRef)le_result_t le_iks_HasKeyValue(uint64_t keyRef)le_result_t le_iks_GetPubKeyValue(uint64_t keyRef, uint8_t *bufPtr, size_t *bufSizePtr)void(* le_iks_DisconnectHandler_t)(void *)Definition: le_iks_interface.h:78le_result_t le_iks_IsKeySizeValid(le_iks_KeyType_t keyType, uint32_t keySize)le_result_t le_iks_GetModuleId(char *idPtr, size_t idPtrSize)uint64_t le_iks_CreateDigest(const char *LE_NONNULL digestId, uint32_t digestSize)le_result_t le_iks_SetModuleId(const char *LE_NONNULL idPtr, uint64_t keyRef)uint64_t le_iks_GetDigest(const char *LE_NONNULL digestId)le_result_t le_iks_DeleteKey(uint64_t keyRef, const uint8_t *authCmdPtr, size_t authCmdSize)le_result_t le_iks_GetUpdateAuthChallenge(uint64_t keyRef, uint8_t *bufPtr, size_t *bufSizePtr)uint64_t le_iks_CreateKey(const char *LE_NONNULL keyId, le_iks_KeyUsage_t keyUsage)void le_iks_DisconnectService(void)le_result_t le_iks_SetDigestUpdateKey(uint64_t digestRef, uint64_t updateKeyRef)le_result_t le_iks_DeleteDigest(uint64_t digestRef, const uint8_t *authCmdPtr, size_t authCmdSize)uint64_t le_iks_CreateSession(uint64_t keyRef)le_result_t le_iks_TryConnectService(void)le_result_t le_iks_SaveDigest(uint64_t digestRef)le_result_t le_iks_ProvisionKeyValue(uint64_t keyRef, const uint8_t *provPackagePtr, size_t provPackageSize)le_result_t le_iks_GenKeyValue(uint64_t keyRef, const uint8_t *authCmdPtr, size_t authCmdSize)le_result_t le_iks_GetProvisionKey(uint8_t *bufPtr, size_t *bufSizePtr)le_result_t le_iks_GetKeySize(uint64_t keyRef, uint32_t *keySizePtr)void le_iks_ConnectService(void)