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 //--------------------------------------------------------------------------------------------------196 //--------------------------------------------------------------------------------------------------205 //--------------------------------------------------------------------------------------------------225 //--------------------------------------------------------------------------------------------------236 //--------------------------------------------------------------------------------------------------254 //--------------------------------------------------------------------------------------------------267 //--------------------------------------------------------------------------------------------------276 //--------------------------------------------------------------------------------------------------285 //--------------------------------------------------------------------------------------------------294 //--------------------------------------------------------------------------------------------------303 //--------------------------------------------------------------------------------------------------312 //--------------------------------------------------------------------------------------------------321 //--------------------------------------------------------------------------------------------------331 //--------------------------------------------------------------------------------------------------338 //--------------------------------------------------------------------------------------------------341 * The update key can be used at a later time to perform authenticated updates of the specified key.344 * The key can be made not updatable by setting the updateKeyRef parameter to zero. Warning, this367 //--------------------------------------------------------------------------------------------------376 //--------------------------------------------------------------------------------------------------380 * If the specified key has an assigned update key then the authCmdPtr must contain a generate key382 * and is signed with the update private key. If the command is valid and authentic then a new key401 //--------------------------------------------------------------------------------------------------412 //--------------------------------------------------------------------------------------------------423 * If the specified key does not have an assigned update key then the provPackagePtr is treated as a426 * If the specified key has an assigned update key then the provPackagePtr must also contain a valid439 //--------------------------------------------------------------------------------------------------450 //--------------------------------------------------------------------------------------------------464 //--------------------------------------------------------------------------------------------------471 //--------------------------------------------------------------------------------------------------476 * command and a valid authentication challenge, obtained by le_iks_GetUpdateAuthChallenge(), and is477 * signed with the update private key. If the command is valid and authentic then the key will be495 //--------------------------------------------------------------------------------------------------506 //--------------------------------------------------------------------------------------------------522 //--------------------------------------------------------------------------------------------------533 //--------------------------------------------------------------------------------------------------546 //--------------------------------------------------------------------------------------------------555 //--------------------------------------------------------------------------------------------------561 * Created digests initially only exist in non-persistent memory, call le_iks_SaveDigest() to save574 //--------------------------------------------------------------------------------------------------585 //--------------------------------------------------------------------------------------------------594 //--------------------------------------------------------------------------------------------------603 //--------------------------------------------------------------------------------------------------607 * updates of the specified digest. The same update key may be used for multiple keys and digests.630 //--------------------------------------------------------------------------------------------------639 //--------------------------------------------------------------------------------------------------645 * If the specified digest does not have an assigned update key then the provPackagePtr is treated648 * If the specified digest has an assigned update key then the provPackagePtr must also contain a662 //--------------------------------------------------------------------------------------------------673 //--------------------------------------------------------------------------------------------------687 //--------------------------------------------------------------------------------------------------694 //--------------------------------------------------------------------------------------------------699 * digest command and a valid authentication challenge, obtained by le_iks_GetUpdateAuthChallenge()700 * and is signed with the update private key. If the command is valid and authentic then the digest714 //--------------------------------------------------------------------------------------------------725 //--------------------------------------------------------------------------------------------------736 //--------------------------------------------------------------------------------------------------747 //--------------------------------------------------------------------------------------------------751 * This challenge code must be included in any update commands created using the specified update760 //--------------------------------------------------------------------------------------------------772 //--------------------------------------------------------------------------------------------------775 * and used to encrypt (wrap) symmetric and private keys for provisioning into the IOT Key Store.788 //--------------------------------------------------------------------------------------------------797 //--------------------------------------------------------------------------------------------------808 //--------------------------------------------------------------------------------------------------817 //--------------------------------------------------------------------------------------------------826 //--------------------------------------------------------------------------------------------------le_result_t le_iks_GenKeyValue(uint64_t keyRef, 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_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_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)void le_iks_DisconnectService(void)le_result_t le_iks_GetWrappingKey(uint8_t *bufPtr, size_t *bufSizePtr)le_result_t le_iks_ProvisionDigest(uint64_t digestRef, const uint8_t *provPackagePtr, size_t provPackageSize)