MCUX CLNS MCUX Crypto Library Normal Secure |

Functions | Variables
mcuxClKey_Functions
mcuxClKey

Defines all functions of mcuxClKey. More...

## Functions

mcuxClKey_Status_Protected_t | mcuxClKey_init (mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, const mcuxClKey_Type_t *type, const mcuxClKey_Protection_t *protection, const uint8_t *const srcKeyData, const uint8_t *const srcAuxData, uint32_t srcAuxSlot)
| Initializes a key handle. More...
mcuxClKey_Status_Protected_t | mcuxClKey_loadCopro (mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, uint32_t dstSlot)
| Load key into destination key slot of a coprocessor. More...
mcuxClKey_Status_Protected_t | mcuxClKey_loadMemory (mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, uint32_t *dstData)
| Load key into destination memory buffer. More...
mcuxClKey_Status_Protected_t | mcuxClKey_flush (mcuxClSession_Handle_t session, mcuxClKey_Handle_t key)
| Flush key from destination which can be a key slot of coprocessor or memory buffer. More...
mcuxClKey_Status_Protected_t | mcuxClKey_setKeyproperties (mcuxClKey_Handle_t key, mcuxClCss_KeyProp_t key_properties)
| Set the requested key properties of the destination key. More...

## Variables

const mcuxClKey_Protection_t | mcuxClKey_protection_none
| Protection function pointer for empty key handling functions. More...
const mcuxClKey_Protection_t | mcuxClKey_protection_ckdf
| Protection function pointer for CSS internal CKDF based key generation. More...

## Detailed Description

Defines all functions of mcuxClKey.

## Function Documentation

## ◆ mcuxClKey_init()

mcuxClKey_Status_Protected_t mcuxClKey_init | ( | mcuxClSession_Handle_t | session,
|  | mcuxClKey_Handle_t | key,
|  | const mcuxClKey_Type_t * | type,
|  | const mcuxClKey_Protection_t * | protection,
|  | const uint8_t *const | srcKeyData,
|  | const uint8_t *const | srcAuxData,
|  | uint32_t | srcAuxSlot
| ) |  |

Initializes a key handle.

Parameters

  [in] | session | Session handle to provide session dependent information
  [in,out] | key | Key handle that will be initialized
  [in] | type | Define which key type shall be initialized
  [in] | protection | Define the protection and flush mechanism that shall be initialized
  [in] | srcKeyData | Provide pointer to source data of the key. This can be a pointer to a plain key buffer, a share, or a key blob. The protection function defines the purpose of this parameter
  [in] | srcAuxData | Provide pointer to aux data of the key. This can be a pointer to a a share, or a wrapping key, or derivation data. The protection function defines the purpose of this parameter
  [in] | srcAuxSlot | Provide aux key slot in case the key is present in a coprocessor keyslot. The protection function defines the purpose of this parameter

Returns
  An error code that can be any error code in MCUXCLKEY_STATUS_, see individual documentation for more information

Return values

  MCUXCLKEY_STATUS_ERROR | on unsuccessful operation
  MCUXCLKEY_STATUS_OK | on successful operation

Examples
  mcuxClKey_example.c, and mcuxClMac_cmac_oneshot_example.c.

## ◆ mcuxClKey_loadCopro()

mcuxClKey_Status_Protected_t mcuxClKey_loadCopro | ( | mcuxClSession_Handle_t | session,
|  | mcuxClKey_Handle_t | key,
|  | uint32_t | dstSlot
| ) |  |

Load key into destination key slot of a coprocessor.

Parameters

  [in] | session | Session handle to provide session dependent information
  [in] | key | Key handle that provides information to load the key
  [out] | dstSlot | Provide destination key slot in case the key has to loaded to a key slot. The protection function defines the purpose of this parameter

Returns
  An error code that can be any error code in MCUXCLKEY_STATUS_, see individual documentation for more information

Return values

  MCUXCLKEY_STATUS_ERROR | on unsuccessful operation
  MCUXCLKEY_STATUS_OK | on successful operation

## ◆ mcuxClKey_loadMemory()

mcuxClKey_Status_Protected_t mcuxClKey_loadMemory | ( | mcuxClSession_Handle_t | session,
|  | mcuxClKey_Handle_t | key,
|  | uint32_t * | dstData
| ) |  |

Load key into destination memory buffer.

Parameters

  [in] | session | Session handle to provide session dependent information
  [in] | key | Key handle that provides information to load the key
  [out] | dstData | Provide 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
  An error code that can be any error code in MCUXCLKEY_STATUS_, see individual documentation for more information

Return values

  MCUXCLKEY_STATUS_ERROR | on unsuccessful operation
  MCUXCLKEY_STATUS_OK | on successful operation

Examples
  mcuxClKey_example.c, and mcuxClMac_cmac_oneshot_example.c.

## ◆ mcuxClKey_flush()

mcuxClKey_Status_Protected_t mcuxClKey_flush | ( | mcuxClSession_Handle_t | session,
|  | mcuxClKey_Handle_t | key
| ) |  |

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

Parameters

  [in] | session | Session handle to provide session dependent information
  [in] | key | Key handle that provides information to flush the key

Returns
  An error code that can be any error code in MCUXCLKEY_STATUS_, see individual documentation for more information

Return values

  MCUXCLKEY_STATUS_ERROR | on unsuccessful operation
  MCUXCLKEY_STATUS_OK | on successful operation

Examples
  mcuxClKey_example.c, and mcuxClMac_cmac_oneshot_example.c.

## ◆ mcuxClKey_setKeyproperties()

mcuxClKey_Status_Protected_t mcuxClKey_setKeyproperties | ( | mcuxClKey_Handle_t | key,
|  | mcuxClCss_KeyProp_t | key_properties
| ) |  |

Set the requested key properties of the destination key.

Parameters

  [in,out] | key | key handle that provides information to flush the key
  [in] | key_properties | Set requested key properties of the destination key

Returns
  An error code that can be any error code in MCUXCLKEY_STATUS_, see individual documentation for more information

Return values

  MCUXCLKEY_STATUS_ERROR | on unsuccessful operation
  MCUXCLKEY_STATUS_OK | on successful operation

Examples
  mcuxClKey_example.c, and mcuxClMac_cmac_oneshot_example.c.

## Variable Documentation

## ◆ mcuxClKey_protection_none

const mcuxClKey_Protection_t mcuxClKey_protection_none

Protection function pointer for empty key handling functions.

See mcuxClKey_Protection for the structure definition. Initializing mcuxClKey_Handle_t with this pointer (via mcuxClKey_init) to use empty key handling.

Parameters defined by protection function
  mcuxClKey_init
    srcKeyData
      RFU.
    srcAuxData
      RFU.
    srcAuxSlot
      RFU.
  mcuxClKey_loadCopro
    This function shall not be used by this protection mechanism.
  mcuxClKey_loadMemory
    dstData
      Pointer to destination key memory. Must not be NULL.

Examples
  mcuxClEcc_Mont_example.c, mcuxClKey_example.c, and mcuxClMac_cmac_oneshot_example.c.

## ◆ mcuxClKey_protection_ckdf

const mcuxClKey_Protection_t mcuxClKey_protection_ckdf

Protection function pointer for CSS internal CKDF based key generation.

See mcuxClKey_Protection for the structure definition. Initializing mcuxClKey_Handle_t with this pointer (via mcuxClKey_init) to use CSS internal CKDF based key generation.

Parameters defined by protection function
  mcuxClKey_init
    srcKeyData
      RFU.
    srcAuxData
      Pointer to key derivation data.
    srcAuxSlot
      Master key slot.
  mcuxClKey_loadCopro
    dstSlot
      Destination key slot of key.
  mcuxClKey_loadMemory
    This function shall not be used by this protection mechanism.