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 values77 //--------------------------------------------------------------------------------------------------81 //--------------------------------------------------------------------------------------------------84 //--------------------------------------------------------------------------------------------------87 * Connect the current client thread to the service providing this API. Block until the service is91 * called before any other functions in this API. Normally, ConnectService is automatically called96 //--------------------------------------------------------------------------------------------------102 //--------------------------------------------------------------------------------------------------105 * Try to connect the current client thread to the service providing this API. Return with an error108 * For each thread that wants to use this API, either ConnectService or TryConnectService must be109 * called before any other functions in this API. Normally, ConnectService is automatically called118 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).121 //--------------------------------------------------------------------------------------------------127 //--------------------------------------------------------------------------------------------------131 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants134 //--------------------------------------------------------------------------------------------------141 //--------------------------------------------------------------------------------------------------147 * longer a connection to the service, and the functions in this API can't be used. For details, see152 //--------------------------------------------------------------------------------------------------159 //--------------------------------------------------------------------------------------------------164 //--------------------------------------------------------------------------------------------------167 //--------------------------------------------------------------------------------------------------171 //--------------------------------------------------------------------------------------------------174 //--------------------------------------------------------------------------------------------------182 //--------------------------------------------------------------------------------------------------185 //--------------------------------------------------------------------------------------------------187 * Sets the module ID. This module ID may be used to uniquely identify the module, device or chip191 * An update key can be set to delete the module ID. If the update key is not set then the module202 //--------------------------------------------------------------------------------------------------211 //--------------------------------------------------------------------------------------------------223 //--------------------------------------------------------------------------------------------------232 //--------------------------------------------------------------------------------------------------237 * authCmdPtr must contain a valid delete module ID command. If the command is valid and authentic250 //--------------------------------------------------------------------------------------------------259 //--------------------------------------------------------------------------------------------------270 //--------------------------------------------------------------------------------------------------279 //--------------------------------------------------------------------------------------------------299 //--------------------------------------------------------------------------------------------------310 //--------------------------------------------------------------------------------------------------328 //--------------------------------------------------------------------------------------------------341 //--------------------------------------------------------------------------------------------------350 //--------------------------------------------------------------------------------------------------359 //--------------------------------------------------------------------------------------------------368 //--------------------------------------------------------------------------------------------------377 //--------------------------------------------------------------------------------------------------386 //--------------------------------------------------------------------------------------------------395 //--------------------------------------------------------------------------------------------------405 //--------------------------------------------------------------------------------------------------412 //--------------------------------------------------------------------------------------------------415 * The update key can be used at a later time to perform authenticated updates of the specified key.438 //--------------------------------------------------------------------------------------------------447 //--------------------------------------------------------------------------------------------------451 * If the specified key has an assigned update key then the authCmdPtr must contain a generate key453 * and is signed with the update private key. If the command is valid and authentic then a new key472 //--------------------------------------------------------------------------------------------------483 //--------------------------------------------------------------------------------------------------491 * If the key is a symmetric then the key value must be encrypted with the provisioning key. If the494 * If the specified key does not have an assigned update key then the provPackagePtr is treated as a497 * If the specified key has an assigned update key then the provPackagePtr must also contain a valid510 //--------------------------------------------------------------------------------------------------521 //--------------------------------------------------------------------------------------------------535 //--------------------------------------------------------------------------------------------------542 //--------------------------------------------------------------------------------------------------547 * command and a valid authentication challenge, obtained by le_iks_GetUpdateAuthChallenge(), and is548 * signed with the update private key. If the command is valid and authentic then the key will be566 //--------------------------------------------------------------------------------------------------577 //--------------------------------------------------------------------------------------------------593 //--------------------------------------------------------------------------------------------------604 //--------------------------------------------------------------------------------------------------617 //--------------------------------------------------------------------------------------------------626 //--------------------------------------------------------------------------------------------------632 * Created digests initially only exist in non-persistent memory, call le_iks_SaveDigest() to save645 //--------------------------------------------------------------------------------------------------656 //--------------------------------------------------------------------------------------------------665 //--------------------------------------------------------------------------------------------------674 //--------------------------------------------------------------------------------------------------678 * updates of the specified digest. The same update key may be used for multiple keys and digests.698 //--------------------------------------------------------------------------------------------------707 //--------------------------------------------------------------------------------------------------713 * If the specified digest does not have an assigned update key then the provPackagePtr is treated716 * If the specified digest has an assigned update key then the provPackagePtr must also contain a730 //--------------------------------------------------------------------------------------------------741 //--------------------------------------------------------------------------------------------------755 //--------------------------------------------------------------------------------------------------762 //--------------------------------------------------------------------------------------------------767 * digest command and a valid authentication challenge, obtained by le_iks_GetUpdateAuthChallenge()768 * and is signed with the update private key. If the command is valid and authentic then the digest782 //--------------------------------------------------------------------------------------------------793 //--------------------------------------------------------------------------------------------------804 //--------------------------------------------------------------------------------------------------815 //--------------------------------------------------------------------------------------------------819 * This challenge code must be included in any update commands created using the specified update828 //--------------------------------------------------------------------------------------------------840 //--------------------------------------------------------------------------------------------------842 * Get the provisioning key. This is a public key that is internally generated by the IOT Key Store843 * and used to encrypt symmetric and private keys for provisioning into the IOT Key Store. This key856 //--------------------------------------------------------------------------------------------------865 //--------------------------------------------------------------------------------------------------876 //--------------------------------------------------------------------------------------------------885 //--------------------------------------------------------------------------------------------------894 //--------------------------------------------------------------------------------------------------le_result_t le_iks_GenKeyValue(uint64_t keyRef, const uint8_t *authCmdPtr, size_t authCmdSize)le_result_t le_iks_DeleteModuleId(const uint8_t *authCmdPtr, size_t authCmdSize)void(* le_iks_DisconnectHandler_t)(void *)Definition: le_iks_interface.h:82le_result_t le_iks_ProvisionKeyValue(uint64_t keyRef, const uint8_t *provPackagePtr, size_t provPackageSize)le_result_t le_iks_HasKeyValue(uint64_t keyRef)le_result_t le_iks_DeleteDigest(uint64_t digestRef, const uint8_t *authCmdPtr, size_t authCmdSize)le_result_t le_iks_CreateKeyByType(const char *LE_NONNULL keyId, le_iks_KeyType_t keyType, uint32_t keySize, uint64_t *keyRefPtr)le_result_t le_iks_CreateKey(const char *LE_NONNULL keyId, le_iks_KeyUsage_t keyUsage, uint64_t *keyRefPtr)le_result_t le_iks_GetDigestSize(uint64_t digestRef, uint32_t *digestSizePtr)le_result_t le_iks_IsKeySizeValid(le_iks_KeyType_t keyType, uint32_t keySize)le_result_t le_iks_SetKeyUpdateKey(uint64_t keyRef, uint64_t updateKeyRef)le_result_t le_iks_SaveKey(uint64_t keyRef)le_result_t le_iks_GetProvisionKey(uint8_t *bufPtr, size_t *bufSizePtr)le_result_t le_iks_CreateSession(uint64_t keyRef, uint64_t *sessionRefPtr)le_result_t le_iks_CreateDigest(const char *LE_NONNULL digestId, uint32_t digestSize, uint64_t *digestRefPtr)le_result_t le_iks_SetModuleId(const char *LE_NONNULL idPtr, uint64_t keyRef)le_result_t le_iks_GetPubKeyValue(uint64_t keyRef, uint8_t *bufPtr, size_t *bufSizePtr)le_result_t le_iks_GetKeySize(uint64_t keyRef, uint32_t *keySizePtr)void le_iks_ConnectService(void)le_result_t le_iks_GetDigest(const char *LE_NONNULL digestId, uint64_t *digestRefPtr)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)le_result_t le_iks_DeleteSession(uint64_t sessionRef)le_result_t le_iks_GetKeyType(uint64_t keyRef, le_iks_KeyType_t *keyTypePtr)le_result_t le_iks_TryConnectService(void)le_result_t le_iks_GetKey(const char *LE_NONNULL keyId, uint64_t *keyRefPtr)le_result_t le_iks_SetDigestUpdateKey(uint64_t digestRef, uint64_t updateKeyRef)le_result_t le_iks_GetDigestValue(uint64_t digestRef, uint8_t *bufPtr, size_t *bufSizePtr)le_result_t le_iks_SaveDigest(uint64_t digestRef)LE_FULL_API void le_iks_SetServerDisconnectHandler(le_iks_DisconnectHandler_t disconnectHandler, void *contextPtr)le_result_t le_iks_GetModuleId(char *idPtr, size_t idPtrSize)void le_iks_DisconnectService(void)le_result_t le_iks_ProvisionDigest(uint64_t digestRef, const uint8_t *provPackagePtr, size_t provPackageSize)