MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxClKey_Functions

Defines all functions of mcuxClKey. More...

Functions

mcuxClKey_Status_t mcuxClKey_init (mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key, mcuxClKey_Type_t type, const uint8_t *pKeyData, uint32_t keyDataLength)
 Initializes a key handle.
void mcuxClKey_linkKeyPair (mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t privKey, mcuxClKey_Handle_t pubKey)
 Establishes a key pair link between a private and public key handle.
mcuxClKey_Status_t mcuxClKey_setProtection (mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key, mcuxClKey_Protection_t protection, uint8_t *pAuxData, mcuxClKey_Handle_t parentKey)
 Configures they protection mechanism for to the given key handle.
mcuxClKey_Status_t mcuxClKey_loadCopro (mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key, uint32_t dstSlot)
 Load key into destination key slot of a coprocessor.
mcuxClKey_Status_t mcuxClKey_loadMemory (mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key, uint32_t *dstData)
 Load key into destination memory buffer.
mcuxClKey_Status_t mcuxClKey_flush (mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key)
 Flush key from destination which can be a key slot of coprocessor or memory buffer.
mcuxClKey_Status_t mcuxClKey_setKeyproperties (mcuxClKey_Handle_t key, mcuxClEls_KeyProp_t *key_properties)
 Set the requested key properties of the destination key.

Detailed Description

Defines all functions of mcuxClKey.

Function Documentation

◆ mcuxClKey_init()

mcuxClKey_Status_t mcuxClKey_init ( mcuxClSession_Handle_t pSession,
mcuxClKey_Handle_t key,
mcuxClKey_Type_t type,
const uint8_t * pKeyData,
uint32_t keyDataLength )

Initializes a key handle.

Initializes a key handle with default protection values.

Parameters
[in]pSessionSession handle to provide session dependent information
[in,out]keyKey handle that will be initialized
[in]typeDefine which key type shall be initialized
[in]pKeyDataProvide pointer to source data of the key. This can be a pointer to a plain key, a share, or a key blob. The protection function defines the purpose of this parameter
[in]keyDataLengthLength of the provided key data pKeyData
Returns
A code-flow protected error code (see Flow Protection API). The error code can be any error code in MCUXCLKEY_STATUS_, see individual documentation for more information
Return values
MCUXCLKEY_STATUS_FAILUREKey initialization failed
MCUXCLKEY_STATUS_OKon successful operation
Examples
mcuxClEcc_EdDSA_Ed25519_example.c, mcuxClEcc_EdDSA_Ed25519ctx_example.c, mcuxClEcc_EdDSA_Ed25519ph_example.c, mcuxClEcc_EdDSA_GenerateSignature_Ed25519_example.c, mcuxClEcc_EdDSA_VerifySignature_Ed25519_example.c, mcuxClEcc_EdDSA_VerifySignature_Invalid_Signature_Ed25519_example.c, mcuxClEcc_MontDH_Curve25519_example.c, mcuxClEcc_MontDH_Curve448_example.c, mcuxClKey_Spake2Plus_example.c, mcuxClRsa_Cipher_Crypt_RSAES_OAEP_1000b_example.c, mcuxClRsa_Cipher_Crypt_RSAES_OAEP_example.c, and mcuxClRsa_Cipher_Crypt_RSAES_PKCS1_v1_5_example.c.

◆ mcuxClKey_linkKeyPair()

void mcuxClKey_linkKeyPair ( mcuxClSession_Handle_t pSession,
mcuxClKey_Handle_t privKey,
mcuxClKey_Handle_t pubKey )

Establishes a key pair link between a private and public key handle.

Parameters
[in]pSessionSession handle to provide session dependent information
[in,out]privKeyKey handle of private key
[in,out]pubKeyKey handle of public key
Returns
void

◆ mcuxClKey_setProtection()

mcuxClKey_Status_t mcuxClKey_setProtection ( mcuxClSession_Handle_t pSession,
mcuxClKey_Handle_t key,
mcuxClKey_Protection_t protection,
uint8_t * pAuxData,
mcuxClKey_Handle_t parentKey )

Configures they protection mechanism for to the given key handle.

Parameters
[in]pSessionSession handle to provide session dependent information
[in,out]keyKey handle that will be configured
[in]protectionDefine the protection and flush mechanism that shall be used with this key
[in]pAuxDataProvide pointer to additional data the protection function may use
[in]parentKeyProvide parent key information in case it exists. The protection function defines the purpose of this parameter
Returns
A code-flow protected error code (see Flow Protection API). The error code can be any error code in MCUXCLKEY_STATUS_, see individual documentation for more information
Return values
MCUXCLKEY_STATUS_ERRORon unsuccessful operation
MCUXCLKEY_STATUS_OKon successful operation

◆ mcuxClKey_loadCopro()

mcuxClKey_Status_t mcuxClKey_loadCopro ( mcuxClSession_Handle_t pSession,
mcuxClKey_Handle_t key,
uint32_t dstSlot )

Load key into destination key slot of a coprocessor.

Parameters
[in]pSessionSession handle to provide session dependent information
[in]keyKey handle that provides information to load the key
[out]dstSlotProvide destination key slot in case the key has to loaded to a key slot. The protection function defines the purpose of this parameter
Returns
A code-flow protected error code (see Flow Protection API). The error code can be any error code in MCUXCLKEY_STATUS_, see individual documentation for more information
Return values
MCUXCLKEY_STATUS_ERRORon unsuccessful operation
MCUXCLKEY_STATUS_OKon successful operation

◆ mcuxClKey_loadMemory()

mcuxClKey_Status_t mcuxClKey_loadMemory ( mcuxClSession_Handle_t pSession,
mcuxClKey_Handle_t key,
uint32_t * dstData )

Load key into destination memory buffer.

Parameters
[in]pSessionSession handle to provide session dependent information
[in]keyKey handle that provides information to load the key
[out]dstDataProvide pointer to destination key memory in case the key has to be loaded to memory. The protection function defines the purpose of this parameter
Returns
A code-flow protected error code (see Flow Protection API). The error code can be any error code in MCUXCLKEY_STATUS_, see individual documentation for more information
Return values
MCUXCLKEY_STATUS_ERRORon unsuccessful operation
MCUXCLKEY_STATUS_OKon successful operation
Examples
mcuxClKey_Spake2Plus_example.c.

◆ mcuxClKey_flush()

mcuxClKey_Status_t mcuxClKey_flush ( mcuxClSession_Handle_t pSession,
mcuxClKey_Handle_t key )

Flush key from destination which can be a key slot of coprocessor or memory buffer.

Parameters
[in]pSessionSession handle to provide session dependent information
[in]keyKey handle that provides information to flush the key
Returns
A code-flow protected error code (see Flow Protection API). The error code can be any error code in MCUXCLKEY_STATUS_, see individual documentation for more information
Return values
MCUXCLKEY_STATUS_ERRORon unsuccessful operation
MCUXCLKEY_STATUS_OKon successful operation
Examples
mcuxClKey_Spake2Plus_example.c, mcuxClKey_example.c, and mcuxClMacModes_Els_Cmac_Aes128_Oneshot_Example.c.

◆ mcuxClKey_setKeyproperties()

mcuxClKey_Status_t mcuxClKey_setKeyproperties ( mcuxClKey_Handle_t key,
mcuxClEls_KeyProp_t * key_properties )

Set the requested key properties of the destination key.

Parameters
[in,out]keykey handle that provides information to flush the key
[in]key_propertiesPointer to the requested key properties of the destination key. Will be set in key->container.pAuxData
Returns
A code-flow protected error code (see Flow Protection API). The error code can be any error code in MCUXCLKEY_STATUS_, see individual documentation for more information
Return values
MCUXCLKEY_STATUS_ERRORon unsuccessful operation
MCUXCLKEY_STATUS_OKon successful operation