14 #ifndef MCUXCLEXAMPLE_ELS_KEY_HELPER_H_ 15 #define MCUXCLEXAMPLE_ELS_KEY_HELPER_H_ 17 #include <mcuxClConfig.h> 18 #include <mcuxClCore_Platform.h> 20 #include <mcuxClExample_RFC3394_Helper.h> 51 static inline bool mcuxClExample_Els_KeyDeleteAll(
void)
81 #define ELS_RFC_PADDING_LENGTH 16U 83 static bool mcuxClExample_load_els_key(
119 if(
true != mcuxClExample_provision_key(helperKeyIdx, AesHelperKeyProp))
159 if(
true != mcuxClExample_provision_key(helperKeyIdx, kwkHelperKeyProp))
#define MCUXCLELS_KEYPROPERTY_KEY_SIZE_256
This value of mcuxClEls_KeyProp_t.ksize indicates a 256 bit key.
Definition: mcuxClEls_Types.h:102
uint32_t kfmt
Defines the key import format, one of MCUXCLELS_KEYIMPORT_KFMT_.
Definition: mcuxClEls_KeyManagement.h:147
#define MCUX_CSSL_FP_FUNCTION_CALLED(...)
Expectation of a called function.
Definition: mcuxCsslFlowProtection.h:730
uint32_t ukwk
Usage permission for key wrapping.
Definition: mcuxClEls_Types.h:260
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_WaitForOperation(mcuxClEls_ErrorHandling_t errorHandling)
Wait for an ELS operation and optionally clear the error status.
#define MCUXCLELS_KEYIMPORT_KFMT_RFC3394
Key format RFC3394 with shares in memory.
Definition: mcuxClEls_KeyManagement.h:83
#define MCUXCLELS_KEYPROPERTY_AES_TRUE
This value of mcuxClEls_KeyProp_t.uaes indicates that the key is an AES key.
Definition: mcuxClEls_Types.h:136
#define MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(...)
Call a flow protected function and check the protection token.
Definition: mcuxCsslFlowProtection.h:576
#define MCUXCLELS_KEYPROPERTY_KWK_TRUE
This value of mcuxClEls_KeyProp_t.ukwk indicates that the key is a Key Wrapping Key.
Definition: mcuxClEls_Types.h:140
struct mcuxClEls_KeyProp_t::@39 bits
Access mcuxClEls_KeyProp_t bit-wise.
#define MCUXCLELS_KEYPROPERTY_BASE_SLOT
This value of mcuxClEls_KeyProp_t.kbase indicates that the slot is the base slot of a 2-slot key.
Definition: mcuxClEls_Types.h:108
#define MCUXCLELS_KEYPROPERTY_ACTIVE_TRUE
This value of mcuxClEls_KeyProp_t.kactv indicates that the slot contains an active key.
Definition: mcuxClEls_Types.h:106
uint32_t upprot_sec
Access restriction to TrustZone secure mode.
Definition: mcuxClEls_Types.h:269
Type for ELS key store key properties.
Definition: mcuxClEls_Types.h:224
#define MCUXCLELS_CIPHER_INTERNAL_KEY
Set this option at mcuxClEls_CipherOption_t.extkey to use a key located in ELS keystore privded by ke...
Definition: mcuxClEls_Cipher.h:74
#define MCUX_CSSL_FP_FUNCTION_CALL_END(...)
End a function call section started by MCUX_CSSL_FP_FUNCTION_CALL_BEGIN.
Definition: mcuxCsslFlowProtection.h:611
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_GetKeyProperties(mcuxClEls_KeyIndex_t keyIdx, mcuxClEls_KeyProp_t *pKeyProp)
Exports the properties of the keys stored in the ELS internal keystore.
Top-level include file for the ELS driver.
#define MCUXCLELS_ERROR_FLAGS_CLEAR
Set this option at mcuxClEls_ErrorHandling_t to clear all ELS error flags.
Definition: mcuxClEls_Common.h:137
#define MCUXCLELS_STATUS_OK_WAIT
An _Async function successfully started an ELS command. Call mcuxClEls_WaitForOperation to complete i...
Definition: mcuxClEls_Types.h:171
#define MCUXCLELS_CIPHER_KEY_SIZE_AES_128
Size of an AES128 key: 128 bit (16 bytes)
Definition: mcuxClEls_Cipher.h:96
uint32_t ksize
Key size.
Definition: mcuxClEls_Types.h:236
struct mcuxClEls_KeyImportOption_t::@37 bits
Access mcuxClEls_KeyImportOption_t bit-wise.
uint32_t kactv
Status flag to indicate whether the key slot contains an active key or not.
Definition: mcuxClEls_Types.h:239
uint32_t kbase
Status flag to indicate whether the key slot is a base slot or the second slot of a 256-bit key.
Definition: mcuxClEls_Types.h:240
#define MCUXCLELS_KEYPROPERTY_SECURE_TRUE
This value of mcuxClEls_KeyProp_t.upprot_sec indicates that the caller must be in secure mode to use ...
Definition: mcuxClEls_Types.h:158
Definition of function identifiers for the flow protection mechanism.
Provides the API for the CSSL flow protection mechanism.
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_KeyDelete_Async(mcuxClEls_KeyIndex_t keyIdx)
Deletes a key from keystore at the given index.
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Reset_Async(mcuxClEls_ResetOption_t options)
Perform a synchronous reset of the ELS.
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_KeyImport_Async(mcuxClEls_KeyImportOption_t options, uint8_t const *pImportKey, size_t importKeyLength, mcuxClEls_KeyIndex_t wrappingKeyIdx, mcuxClEls_KeyIndex_t targetKeyIdx)
Imports a key from external storage to an internal key register.
Command option bit field for mcuxClEls_KeyImport_Async.
Definition: mcuxClEls_KeyManagement.h:136
uint32_t uaes
Usage permission for AES.
Definition: mcuxClEls_Types.h:258
#define MCUXCLELS_STATUS_OK
No error occurred.
Definition: mcuxClEls_Types.h:170
uint32_t mcuxClEls_KeyIndex_t
Type for ELS keystore indices.
Definition: mcuxClEls_Types.h:221
uint32_t upprot_priv
Access restriction to privileged mode.
Definition: mcuxClEls_Types.h:268
#define MCUXCLELS_KEYPROPERTY_PRIVILEGED_TRUE
This value of mcuxClEls_KeyProp_t.upprot_priv indicates that the caller must be in privileged mode to...
Definition: mcuxClEls_Types.h:156
#define MCUXCLELS_CIPHER_KEY_SIZE_AES_256
Size of an AES192 key: 256 bit (32 bytes)
Definition: mcuxClEls_Cipher.h:98