Defines all functions of mcuxClKey. More...
Functions | |
| mcuxClKey_Status_t | mcuxClKey_init (mcuxClSession_Handle_t session, 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 session, mcuxClKey_Handle_t privKey, mcuxClKey_Handle_t pubKey) |
| Establishes a key pair link between a private and public key handle. | |
| mcuxClKey_Status_t | mcuxClKey_setEncoding (mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, mcuxClKey_Encoding_t encoding, const uint8_t *pAuxData, uint32_t auxDataLength) |
| Configures the encoding mechanism for the given key handle. | |
| mcuxClKey_Status_t | mcuxClKey_loadCopro (mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, uint32_t loadOptions) |
| Load key into destination key slot of a coprocessor. | |
| mcuxClKey_Status_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. | |
| mcuxClKey_Status_t | mcuxClKey_generate_keypair (mcuxClSession_Handle_t session, mcuxClKey_Generation_t generation, mcuxClKey_Handle_t privKey, mcuxClKey_Handle_t pubKey) |
| Key-pair generation function. | |
| mcuxClKey_Status_t | mcuxClKey_agreement (mcuxClSession_Handle_t session, mcuxClKey_Agreement_t agreement, mcuxClKey_Handle_t key, mcuxClKey_Handle_t otherKey, mcuxClKey_Agreement_AdditionalInput_t additionalInputs[], uint32_t numberOfInputs, uint8_t *pOut, uint32_t *const pOutLength) |
| Key agreement function. | |
| mcuxClKey_Status_t | mcuxClKey_encode (mcuxClSession_Handle_t session, mcuxClKey_Encoding_t encoding, mcuxClKey_Handle_t encodedKey, mcuxClKey_Type_t type, const uint8_t *pPlainKeyData, uint32_t plainKeyDataLength, const uint8_t *pAuxData, uint32_t auxDataLength, uint8_t *pEncodedKeyData, uint32_t *const pEncodedKeyDataLength) |
| Key descriptor initialization function including applying a encoding mechanism. | |
| mcuxClKey_Status_t | mcuxClKey_recode (mcuxClSession_Handle_t session, mcuxClKey_Handle_t encodedKey, mcuxClKey_Encoding_t encoding, mcuxClKey_Handle_t recodedKey, const uint8_t *pAuxData, uint32_t auxDataLength, uint8_t *pEncodedKeyData, uint32_t *const pEncodedKeyDataLength) |
| Key recoding (re-encoding) function to apply a new encoding to key material. | |
| mcuxClKey_Status_t | mcuxClKey_validate (mcuxClSession_Handle_t session, mcuxClKey_Validation_t validation, mcuxClKey_Handle_t key) |
| Key validation function. | |
Defines all functions of mcuxClKey.
| mcuxClKey_Status_t mcuxClKey_init | ( | mcuxClSession_Handle_t | session, |
| 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 encoding values.
| session | Session handle to provide session dependent information | |
| key | Key handle that will be initialized (word-aligned) | |
| type | Define which key type shall be initialized | |
| [in] | pKeyData | Pointer to the source data of the key. This can be a pointer to a plain key, any supported encoded key, a share or a key blob. The encoding mechanism defines the purpose of this parameter. |
| keyDataLength | Length of the provided key data pKeyData |
| MCUXCLKEY_STATUS_FAILURE | Key initialization failed |
| MCUXCLKEY_STATUS_OK | on successful operation |
| void mcuxClKey_linkKeyPair | ( | mcuxClSession_Handle_t | session, |
| mcuxClKey_Handle_t | privKey, | ||
| mcuxClKey_Handle_t | pubKey ) |
Establishes a key pair link between a private and public key handle.
| session | Session handle to provide session dependent information |
| privKey | Key handle of private key (word-aligned) |
| pubKey | Key handle of public key (word-aligned) |
| void |
| mcuxClKey_Status_t mcuxClKey_setEncoding | ( | mcuxClSession_Handle_t | session, |
| mcuxClKey_Handle_t | key, | ||
| mcuxClKey_Encoding_t | encoding, | ||
| const uint8_t * | pAuxData, | ||
| uint32_t | auxDataLength ) |
Configures the encoding mechanism for the given key handle.
This function shall be used when the key material of a key handle is already encoded. mcuxClKey_init must be called to initialize the key handle first.
| session | Session handle to provide session dependent information | |
| key | Key handle that will be configured (word-aligned) | |
| encoding | Define the encoding and flush mechanism that shall be used with this key | |
| [in] | pAuxData | Auxiliary data needed for the given key encoding. |
| auxDataLength | Number of bytes available in the pAuxData buffer. |
| MCUXCLKEY_STATUS_ERROR | on unsuccessful operation |
| MCUXCLKEY_STATUS_OK | on successful operation |
| mcuxClKey_Status_t mcuxClKey_loadCopro | ( | mcuxClSession_Handle_t | session, |
| mcuxClKey_Handle_t | key, | ||
| uint32_t | loadOptions ) |
Load key into destination key slot of a coprocessor.
| session | Session handle to provide session dependent information |
| key | Key handle that provides of the key to be loaded (word-aligned) |
| loadOptions | Provide the destination key slot in the hardware and associated options. The key slot must be available in the coprocessor that fits the key type. The slot shall be a provided constant in MCUXCLKEY_LOADOPTION_SLOT_. Additional options in MCUXCLKEY_LOADOPTION_ can be provided. |
| MCUXCLSGI_STATUS_UNWRAP_ERROR | Error during RFC3394 Key Unwrap detected. An SGI reset or FULL_FLUSH needs to be performed. |
| mcuxClKey_Status_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.
| session | Session handle to provide session dependent information |
| key | Key handle that provides information to flush the key from its location (word-aligned) |
| MCUXCLKEY_STATUS_OK | on successful operation |
| MCUXCLKEY_STATUS_FAULT_ATTACK | if a fault is detected |
| mcuxClKey_Status_t mcuxClKey_generate_keypair | ( | mcuxClSession_Handle_t | session, |
| mcuxClKey_Generation_t | generation, | ||
| mcuxClKey_Handle_t | privKey, | ||
| mcuxClKey_Handle_t | pubKey ) |
Key-pair generation function.
This function can be used to perform a key-pair generation operation. The generated keys are linked with each other using mcuxClKey_linkKeyPair.
Note: the key handles privKey and pubKey must already be initialized and contain a proper key type (matching to the generation algorithm), encoding mechanism and enough space for key data buffers.
| [in] | session | Handle for the current CL session. |
| [in] | generation | Key generation algorithm that determines the key data stored in privKey and pubKey. |
| privKey | Key handle for the private key (word-aligned). | |
| pubKey | Key handle for the public key (word-aligned). |
| MCUXCLKEY_STATUS_OK | Key generation operation executed successfully. |
| MCUXCLKEY_STATUS_INVALID_INPUT | The input parameters are not valid. |
| MCUXCLKEY_STATUS_ERROR | An error occurred during the execution. |
| MCUXCLKEY_STATUS_FAILURE | The key generation failed. RSA-specific: this occurs in case the key generation exceeds the limit of iterations to generate a prime. |
| MCUXCLKEY_STATUS_FAULT_ATTACK | An error occurred during the execution. |
| mcuxClKey_Status_t mcuxClKey_agreement | ( | mcuxClSession_Handle_t | session, |
| mcuxClKey_Agreement_t | agreement, | ||
| mcuxClKey_Handle_t | key, | ||
| mcuxClKey_Handle_t | otherKey, | ||
| mcuxClKey_Agreement_AdditionalInput_t | additionalInputs[], | ||
| uint32_t | numberOfInputs, | ||
| uint8_t * | pOut, | ||
| uint32_t *const | pOutLength ) |
Key agreement function.
This function can be used to perform a Diffie-Hellman-like key agreement operation.
| session | Handle for the current CL session. | |
| agreement | Key agreement algorithm that determines the value of pOut. | |
| key | First key to be used for the agreement operation (word-aligned). | |
| otherKey | Other key to be used for the agreement operation (word-aligned). | |
| additionalInputs | Additional input needed for the agreement operation. | |
| numberOfInputs | Number of the additional inputs needed for the agreement operation. | |
| [out] | pOut | Pointer to a memory location to store the agreed key. |
| [out] | pOutLength | Will be incremented by the number of bytes written to pOut. |
| mcuxClKey_Status_t mcuxClKey_encode | ( | mcuxClSession_Handle_t | session, |
| mcuxClKey_Encoding_t | encoding, | ||
| mcuxClKey_Handle_t | encodedKey, | ||
| mcuxClKey_Type_t | type, | ||
| const uint8_t * | pPlainKeyData, | ||
| uint32_t | plainKeyDataLength, | ||
| const uint8_t * | pAuxData, | ||
| uint32_t | auxDataLength, | ||
| uint8_t * | pEncodedKeyData, | ||
| uint32_t *const | pEncodedKeyDataLength ) |
Key descriptor initialization function including applying a encoding mechanism.
This function performs the initialization of a Key descriptor. In addition the given encoding mechanism gets applied to the given raw key data.
| session | Handle for the current CL session. | |
| encoding | Encoding mechanism to be applied to the given pPlainKeyData. | |
| encodedKey | Key to be initialized and encoded (word-aligned). | |
| type | Type of the key. | |
| [in] | pPlainKeyData | Plain raw key data. |
| plainKeyDataLength | Number of bytes available in the pPlainKeyData. | |
| [in] | pAuxData | Auxiliary data needed for the given key encoding. |
| auxDataLength | Number of bytes available in the pAuxData buffer. | |
| [out] | pEncodedKeyData | Encoded raw key data (after applying encoding to the pPlainKeyData) |
| [out] | pEncodedKeyDataLength | Incremented with the number of bytes written at pEncodedKeyData. |
| mcuxClKey_Status_t mcuxClKey_recode | ( | mcuxClSession_Handle_t | session, |
| mcuxClKey_Handle_t | encodedKey, | ||
| mcuxClKey_Encoding_t | encoding, | ||
| mcuxClKey_Handle_t | recodedKey, | ||
| const uint8_t * | pAuxData, | ||
| uint32_t | auxDataLength, | ||
| uint8_t * | pEncodedKeyData, | ||
| uint32_t *const | pEncodedKeyDataLength ) |
Key recoding (re-encoding) function to apply a new encoding to key material.
This function performs the initialization of the key descriptor recodedKey. In addition, it decodes the key material of the given encodedKey and recodes (re-encoded) the plain material with the given encoding to finalize the init of the recodedKey.
In-place recoding is not supported.
| session | Handle for the current CL session. | |
| [in] | encodedKey | Input key associated with the material to be recoded. This key object is used as const input (word-aligned). |
| encoding | Encoding mechanism to be applied to the plain key material of the given encodedKey. | |
| recodedKey | Output key handle containing the recoded key. Must point to an uninitialized key handle, in-place recoding is not supported (word-aligned). | |
| [in] | pAuxData | Auxiliary data needed for the given key encoding. |
| auxDataLength | Number of bytes available in the pAuxData buffer. | |
| [out] | pEncodedKeyData | Recoded key data (after applying encoding to the decoded key data associated with encodedKey). |
| [out] | pEncodedKeyDataLength | Incremented with the number of bytes written to pEncodedKeyData. |
| mcuxClKey_Status_t mcuxClKey_validate | ( | mcuxClSession_Handle_t | session, |
| mcuxClKey_Validation_t | validation, | ||
| mcuxClKey_Handle_t | key ) |
Key validation function.
This function validates a key.
| [in] | session | Handle for the current CL session. |
| [in] | validation | Key validation type. |
| [in] | key | Key handle for the key to be validated (word-aligned). |
| MCUXCLKEY_STATUS_VALIDATION_PASSED | Key validation successful |
| MCUXCLKEY_STATUS_VALIDATION_FAILED | Key validation failed |