Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
SecurityManagerEventHandler< Impl > Class Template Reference
Handle events generated by ble::pal::SecurityManager. More...
#include <PalSecurityManager.h>
Inherits StaticInterface< Impl, SecurityManagerEventHandler >.
Public Member Functions | |
void | on_pairing_request (connection_handle_t connection, bool oob_data_flag, AuthenticationMask authentication_requirements, KeyDistribution initiator_dist, KeyDistribution responder_dist) |
Request pairing. | |
void | on_pairing_error (connection_handle_t connection, pairing_failure_t error) |
Indicate that the pairing has failed. | |
void | on_pairing_timed_out (connection_handle_t connection) |
Indicate that the pairing has timed out. | |
void | on_pairing_completed (connection_handle_t connection) |
Indicate that the pairing for the link has completed. | |
void | on_valid_mic_timeout (connection_handle_t connection) |
Indicate that the authentication timeout time has elapsed and we received no packets with a valid MIC in that time. | |
void | on_slave_security_request (connection_handle_t connection, AuthenticationMask authentication) |
Ask the stack to evaluate the security request received from the slave. | |
void | on_link_encryption_result (connection_handle_t connection, link_encryption_t result) |
Inform the application of the result of an encryption request. | |
void | on_link_encryption_request_timed_out (connection_handle_t connection) |
Indicate that the encryption request failed due to timeout. | |
void | on_passkey_display (connection_handle_t connection, passkey_num_t passkey) |
Inform the application that should display a passkey. | |
void | on_confirmation_request (connection_handle_t connection) |
Indicate that user confirmation is required to confirm matching passkeys displayed on devices. | |
void | on_passkey_request (connection_handle_t connection) |
Request the passkey entered during pairing. | |
void | on_keypress_notification (connection_handle_t connection, Keypress_t keypress) |
Indicate that a key has been pressed by the peer. | |
void | on_secure_connections_oob_request (connection_handle_t connection) |
Request OOB data from the user application. | |
void | on_legacy_pairing_oob_request (connection_handle_t connection) |
Request OOB data from the user application. | |
void | on_secure_connections_oob_generated (const oob_lesc_value_t &random, const oob_confirm_t &confirm) |
Send OOB data to the application for transport to the peer. | |
void | on_secure_connections_ltk_generated (connection_handle_t connection, const ltk_t <k) |
Store the results of key generation of the stage 2 of secure connections pairing. | |
void | on_keys_distributed_ltk (connection_handle_t connection, const ltk_t <k) |
Store the results of key distribution after LTK has been received. | |
void | on_keys_distributed_ediv_rand (connection_handle_t connection, const ediv_t &ediv, const rand_t &rand) |
Store the results of key distribution after EDIV and RAND has been received. | |
void | on_keys_distributed_local_ltk (connection_handle_t connection, const ltk_t <k) |
Store the local key, if we are slave now or in the future this will be used to encrypt. | |
void | on_keys_distributed_local_ediv_rand (connection_handle_t connection, const ediv_t &ediv, const rand_t &rand) |
Store the EDIV and RAND that will be used to identify the stored local LTK. | |
void | on_keys_distributed_irk (connection_handle_t connection, const irk_t &irk) |
Store the results of key distribution after IRK has been received. | |
void | on_keys_distributed_bdaddr (connection_handle_t connection, advertising_peer_address_type_t peer_identity_address_type, const address_t &peer_identity_address) |
Store the identity address of the peer after it has been distributed. | |
void | on_keys_distributed_csrk (connection_handle_t connection, const csrk_t &csrk) |
Store the peer's CSRK after it has been distributed. | |
void | on_ltk_request (connection_handle_t connection, const ediv_t &ediv, const rand_t &rand) |
Request the LTK since the peer is asking us to encrypt the link. | |
void | on_ltk_request (connection_handle_t connection) |
Request the LTK since the peer is asking us to encrypt the link. | |
Impl * | impl () |
const Impl * | impl () const |
Detailed Description
template<class Impl>
class ble::pal::SecurityManagerEventHandler< Impl >
Handle events generated by ble::pal::SecurityManager.
Definition at line 209 of file PalSecurityManager.h.
Member Function Documentation
Impl* impl | ( | ) | [inherited] |
- Returns:
- A pointer to the implementation class.
Definition at line 35 of file StaticInterface.h.
const Impl* impl | ( | ) | const [inherited] |
- Returns:
- A pointer to the implementation class.
Definition at line 43 of file StaticInterface.h.
void on_confirmation_request | ( | connection_handle_t | connection ) |
Indicate that user confirmation is required to confirm matching passkeys displayed on devices.
- Parameters:
-
[in] connection connection handle
- See also:
- BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E, 7.7.42
Definition at line 371 of file PalSecurityManager.h.
void on_keypress_notification | ( | connection_handle_t | connection, |
Keypress_t | keypress | ||
) |
Indicate that a key has been pressed by the peer.
- Parameters:
-
[in] connection connection handle [in] keypress type of keypress event
- See also:
- BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part H, 3.5.8
Definition at line 397 of file PalSecurityManager.h.
void on_keys_distributed_bdaddr | ( | connection_handle_t | connection, |
advertising_peer_address_type_t | peer_identity_address_type, | ||
const address_t & | peer_identity_address | ||
) |
Store the identity address of the peer after it has been distributed.
- Parameters:
-
[in] connection connection handle [in] peer_identity_address_type public or private address indication [in] peer_identity_address peer address
Definition at line 543 of file PalSecurityManager.h.
void on_keys_distributed_csrk | ( | connection_handle_t | connection, |
const csrk_t & | csrk | ||
) |
Store the peer's CSRK after it has been distributed.
- Parameters:
-
[in] connection connection handle [in] csrk signing key
Definition at line 557 of file PalSecurityManager.h.
void on_keys_distributed_ediv_rand | ( | connection_handle_t | connection, |
const ediv_t & | ediv, | ||
const rand_t & | rand | ||
) |
Store the results of key distribution after EDIV and RAND has been received.
- Parameters:
-
[in] connection connection handle [in] ltk long term key from the peer
Definition at line 483 of file PalSecurityManager.h.
void on_keys_distributed_irk | ( | connection_handle_t | connection, |
const irk_t & | irk | ||
) |
Store the results of key distribution after IRK has been received.
- Parameters:
-
[in] connection connection handle [in] irk identity resolution key
Definition at line 529 of file PalSecurityManager.h.
void on_keys_distributed_local_ediv_rand | ( | connection_handle_t | connection, |
const ediv_t & | ediv, | ||
const rand_t & | rand | ||
) |
Store the EDIV and RAND that will be used to identify the stored local LTK.
if we are slave that LTK will be used to encrypt, otherwise this will be stored to be used in case of role reversal.
- Parameters:
-
[in] connection connection handle [in] ediv identifies LTK [in] rand identifies LTK
Definition at line 515 of file PalSecurityManager.h.
void on_keys_distributed_local_ltk | ( | connection_handle_t | connection, |
const ltk_t & | ltk | ||
) |
Store the local key, if we are slave now or in the future this will be used to encrypt.
- Parameters:
-
[in] connection connection handle [in] ltk key sent to the peer
Definition at line 498 of file PalSecurityManager.h.
void on_keys_distributed_ltk | ( | connection_handle_t | connection, |
const ltk_t & | ltk | ||
) |
Store the results of key distribution after LTK has been received.
- Parameters:
-
[in] connection connection handle [in] ltk long term key from the peer
Definition at line 470 of file PalSecurityManager.h.
void on_legacy_pairing_oob_request | ( | connection_handle_t | connection ) |
Request OOB data from the user application.
- Parameters:
-
[in] connection connection handle
- Note:
- shall be followed by: pal::SecurityManager::legacy_pairing_oob_request_reply or a cancellation of the procedure.
Definition at line 424 of file PalSecurityManager.h.
void on_link_encryption_request_timed_out | ( | connection_handle_t | connection ) |
Indicate that the encryption request failed due to timeout.
- Parameters:
-
[in] connection connection handle
Definition at line 338 of file PalSecurityManager.h.
void on_link_encryption_result | ( | connection_handle_t | connection, |
link_encryption_t | result | ||
) |
Inform the application of the result of an encryption request.
- Note:
- Do no call if request timed out, call on_link_encryption_request_timed_out instead.
- Parameters:
-
[in] connection connection handle [in] result encryption state of the link
Definition at line 326 of file PalSecurityManager.h.
void on_ltk_request | ( | connection_handle_t | connection ) |
Request the LTK since the peer is asking us to encrypt the link.
- Note:
- No EDIV or RAND is provided as this requests a secure connections LTK where their values are all zeroes
- Parameters:
-
[in] connection connection handle
Definition at line 588 of file PalSecurityManager.h.
void on_ltk_request | ( | connection_handle_t | connection, |
const ediv_t & | ediv, | ||
const rand_t & | rand | ||
) |
Request the LTK since the peer is asking us to encrypt the link.
We need to provide the LTK based on the EDIV and RAND provided by the other side. This is called on the slave.
- Parameters:
-
[in] connection connection handle [in] ediv identifies LTK [in] rand identifies LTK
Definition at line 573 of file PalSecurityManager.h.
void on_pairing_completed | ( | connection_handle_t | connection ) |
Indicate that the pairing for the link has completed.
- Parameters:
-
[in] connection connection handle
Definition at line 277 of file PalSecurityManager.h.
void on_pairing_error | ( | connection_handle_t | connection, |
pairing_failure_t | error | ||
) |
Indicate that the pairing has failed.
- Note:
- Any subsequent pairing procedure shall restart from the Pairing Feature Exchange phase.
- Parameters:
-
[in] connection connection handle [in] error reason for the failed pairing
Definition at line 254 of file PalSecurityManager.h.
void on_pairing_request | ( | connection_handle_t | connection, |
bool | oob_data_flag, | ||
AuthenticationMask | authentication_requirements, | ||
KeyDistribution | initiator_dist, | ||
KeyDistribution | responder_dist | ||
) |
Request pairing.
This is called on the slave in response to a request from the master. Upper layer shall either send a pairing response (send_pairing_response) or cancel the pairing procedure (cancel_pairing).
- Parameters:
-
[in] connection connection handle [in] oob_data_flag is out of band data present [in] authentication_requirements authentication requirements [in] initiator_dist key distribution [in] responder_dist key distribution
Definition at line 230 of file PalSecurityManager.h.
void on_pairing_timed_out | ( | connection_handle_t | connection ) |
Indicate that the pairing has timed out.
- Parameters:
-
[in] connection connection handle
Definition at line 266 of file PalSecurityManager.h.
void on_passkey_display | ( | connection_handle_t | connection, |
passkey_num_t | passkey | ||
) |
Inform the application that should display a passkey.
- Parameters:
-
[in] connection connection handle [in] passkey passkey to be displayed
Definition at line 354 of file PalSecurityManager.h.
void on_passkey_request | ( | connection_handle_t | connection ) |
Request the passkey entered during pairing.
- Note:
- shall be followed by: pal::SecurityManager::passkey_request_reply
- Parameters:
-
[in] connection connection handle or a cancellation of the procedure.
Definition at line 384 of file PalSecurityManager.h.
void on_secure_connections_ltk_generated | ( | connection_handle_t | connection, |
const ltk_t & | ltk | ||
) |
Store the results of key generation of the stage 2 of secure connections pairing.
- See also:
- BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part H - 2.3.5.6.5
- Parameters:
-
[in] connection connection handle [in] ltk long term key from the peer
Definition at line 457 of file PalSecurityManager.h.
void on_secure_connections_oob_generated | ( | const oob_lesc_value_t & | random, |
const oob_confirm_t & | confirm | ||
) |
Send OOB data to the application for transport to the peer.
- Parameters:
-
[in] connection connection handle [in] random random number used to generate the confirmation [in] confirm confirmation value to be use for authentication in secure connections pairing
- Returns:
- BLE_ERROR_NONE or appropriate error code indicating the failure reason.
Definition at line 439 of file PalSecurityManager.h.
void on_secure_connections_oob_request | ( | connection_handle_t | connection ) |
Request OOB data from the user application.
- Parameters:
-
[in] connection connection handle
- Note:
- shall be followed by: pal::SecurityManager::secure_connections_oob_request_reply or a cancellation of the procedure.
Definition at line 411 of file PalSecurityManager.h.
void on_slave_security_request | ( | connection_handle_t | connection, |
AuthenticationMask | authentication | ||
) |
Ask the stack to evaluate the security request received from the slave.
This might result in the stack enabling encryption, or pairing/re-pairing.
- Parameters:
-
[in] connection connection handle [in] authentication authentication requirements from the slave
Definition at line 307 of file PalSecurityManager.h.
void on_valid_mic_timeout | ( | connection_handle_t | connection ) |
Indicate that the authentication timeout time has elapsed and we received no packets with a valid MIC in that time.
- Parameters:
-
[in] connection connection handle
- See also:
- BLUETOOTH SPECIFICATION Version 5.0 | Vol 6, Part B, 5.4
Definition at line 294 of file PalSecurityManager.h.
Generated on Tue Jul 12 2022 13:55:41 by
