MCUX CLNS MCUX Crypto Library Normal Secure |

Functions
mcuxClCss_KeyManagement_Functions
mcuxClCss » mcuxClCss_KeyManagement

Defines all functions of mcuxClCss_KeyManagement. More...

## Functions
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_KeyDelete_Async (mcuxClCss_KeyIndex_t keyIdx)
| Deletes a key from keystore at the given index. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_KeyImport_Async (mcuxClCss_KeyImportOption_t options, uint8_t const *pImportKey, size_t importKeyLength, mcuxClCss_KeyIndex_t wrappingKeyIdx, mcuxClCss_KeyIndex_t targetKeyIdx)
| Imports a key from external storage to an internal key register. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_KeyExport_Async (mcuxClCss_KeyIndex_t wrappingKeyIdx, mcuxClCss_KeyIndex_t exportKeyIdx, uint8_t *pOutput)
| Exports a key from an internal key register to external storage, using a wrapping key. More...
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_GetKeyProperties (mcuxClCss_KeyIndex_t keyIdx, mcuxClCss_KeyProp_t *pKeyProp)
| Exports the properties of the keys stored in the CSS internal keystore. More...

## Detailed Description

Defines all functions of mcuxClCss_KeyManagement.

## Function Documentation

## ◆ mcuxClCss_KeyDelete_Async()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_KeyDelete_Async | ( | mcuxClCss_KeyIndex_t | keyIdx | ) |

Deletes a key from keystore at the given index.

Before execution, CSS will wait until mcuxClCss_HwState_t.drbgentlvl == MCUXCLCSS_STATUS_DRBGENTLVL_LOW. This can lead to a delay if the DRBG is in a state with less security strength at the time of the call.

Call mcuxClCss_WaitForOperation to complete the operation.

Parameters

  [in] | keyIdx | The index of the key to be deleted

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

Return values

  MCUXCLCSS_STATUS_SW_INVALID_PARAM | if invalid parameters were specified
  MCUXCLCSS_STATUS_SW_CANNOT_INTERRUPT | if a running operation prevented the request
  MCUXCLCSS_STATUS_OK_WAIT | on successful request

Examples
  ecc_keygen_sign_verify.c, mcuxClEcc_Mont_example.c, rng_prng_get_random.c, and tls_master_key_session_keys.c.

## ◆ mcuxClCss_KeyImport_Async()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_KeyImport_Async | ( | mcuxClCss_KeyImportOption_t | options,
|  | uint8_t const * | pImportKey,
|  | size_t | importKeyLength,
|  | mcuxClCss_KeyIndex_t | wrappingKeyIdx,
|  | mcuxClCss_KeyIndex_t | targetKeyIdx
| ) |  |

Imports a key from external storage to an internal key register.

Call mcuxClCss_WaitForOperation to complete the operation.

Parameters

  [in] | options | One of MCUXCLCSS_KEYIMPORT_KFMT_
  [in] | pImportKey | Pointer to the RFC3394 container of the key to be imported
  [in] | importKeyLength | Length of the RFC3394 container of the key to be imported
  [in] | wrappingKeyIdx | Index of the key wrapping key, if importing RFC3394 format
  [in] | targetKeyIdx | The desired key index of the imported key

Parameter properties
  `options.kfmt` != MCUXCLCSS_KEYIMPORT_KFMT_RFC3394
    - `pImportKey` is ignored.
    - `importKeyLength` is ignored.
    - `wrappingKeyIdx` is ignored.
    - `targetKeyIdx` is ignored. The unpacked key is automatically stored in key slots 0, 1.

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

Return values

  MCUXCLCSS_STATUS_SW_INVALID_PARAM | if invalid parameters were specified
  MCUXCLCSS_STATUS_SW_CANNOT_INTERRUPT | if a running operation prevented the request
  MCUXCLCSS_STATUS_OK_WAIT | on successful request

## ◆ mcuxClCss_KeyExport_Async()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_KeyExport_Async | ( | mcuxClCss_KeyIndex_t | wrappingKeyIdx,
|  | mcuxClCss_KeyIndex_t | exportKeyIdx,
|  | uint8_t * | pOutput
| ) |  |

Exports a key from an internal key register to external storage, using a wrapping key.

Call mcuxClCss_WaitForOperation to complete the operation.

Parameters

  [in] | wrappingKeyIdx | The key used for key wrapping
  [in] | exportKeyIdx | The key to export
  [out] | pOutput | The memory address of the exported key

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

Return values

  MCUXCLCSS_STATUS_SW_INVALID_PARAM | if invalid parameters were specified
  MCUXCLCSS_STATUS_SW_CANNOT_INTERRUPT | if a running operation prevented the request
  MCUXCLCSS_STATUS_OK_WAIT | on successful request

Parameters

  [in] | wrappingKeyIdx | The key used for key wrapping
  [in] | exportKeyIdx | The key to export
  [out] | pOutput | The memory address of the exported key

## ◆ mcuxClCss_GetKeyProperties()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_GetKeyProperties | ( | mcuxClCss_KeyIndex_t | keyIdx,
|  | mcuxClCss_KeyProp_t * | pKeyProp
| ) |  |

Exports the properties of the keys stored in the CSS internal keystore.

Call mcuxClCss_WaitForOperation to complete the operation.

Parameters

  [in] | keyIdx | Request key properties of the index defined here
  [out] | pKeyProp | Key properties of the index provided

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

Return values

  MCUXCLCSS_STATUS_SW_CANNOT_INTERRUPT | if a running operation prevented the request
  MCUXCLCSS_STATUS_OK | on successful request

Examples
  tls_master_key_session_keys.c.