Module for handling LESC related events.
More...
Module for handling LESC related events.
Function for initializing the LESC module.
This function initializes the nrf_crypto for ECC and ECDH calculations, which are required to handle LESC authentication procedures.
- Return values
-
Function for generating ECC keypair used for the LESC procedure.
This function generates an ECC key pair, which consists of a private and public key. Keys are generated using ECC and are used to create LESC DH key during authentication procedures.
- Return values
-
void nrf_ble_lesc_on_ble_evt |
( |
ble_evt_t const * |
p_ble_evt | ) |
|
Function for handling BLE stack events.
This function handles events from the BLE stack that are of interest to the module.
- Parameters
-
[in] | p_ble_evt | Event received from the BLE stack. |
ret_code_t nrf_ble_lesc_own_oob_data_generate |
( |
void |
| ) |
|
Function for generating LESC OOB data.
This function generates LESC OOB data, which can be transmitted Out-Of-Band to the peer device and used during LESC procedure. It is required to generate ECC keypair with nrf_ble_lesc_keypair_generate before calling this function.
- Return values
-
NRF_SUCCESS | If the operation was successful. |
NRF_ERROR_INVALID_STATE | If the ECC keypair hasn't been generated or is currently being generated. |
Function for accessing LESC OOB data.
This function can be used to access LESC OOB data that is associated with this device. It is required to regenerate LESC OOB data with nrf_ble_lesc_own_oob_data_generate, after each change of ECC keypair with nrf_ble_lesc_keypair_generate.
- Returns
- Pointer to the LESC OOB data or NULL if the data has not been generated yet or is no no longer valid.
Function for setting the handler used to retrieve peer OOB data.
- Parameters
-
[in] | handler | Function to retrieve peer OOB data. |
Function for accessing the ECC public key used for LESC DH key generation.
This function can be used to access the ECC public key, which is required to generate a LESC DH key at the peer side.
- Returns
- Pointer to the generated public key or NULL if the key has not been generated yet.
Function for responding to a DH key requests.
This function calculates DH keys and supplies them to the SoftDevice if there are any pending requests for keys.
- Note
- This function should be called systematically (e.g. in the main application loop) to handle any pending DH key requests.
- Return values
-