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.
SecurityManager::EventHandler Class Reference
Handle events generated by ble::pal::SecurityManager. More...
#include <PalSecurityManager.h>
Inherited by GenericSecurityManager.
Public Member Functions | |
virtual void | on_pairing_request (connection_handle_t connection, bool oob_data_flag, AuthenticationMask authentication_requirements, KeyDistribution initiator_dist, KeyDistribution responder_dist)=0 |
Request pairing. | |
virtual void | on_pairing_error (connection_handle_t connection, pairing_failure_t error)=0 |
Indicate that the pairing has failed. | |
virtual void | on_pairing_timed_out (connection_handle_t connection)=0 |
Indicate that the pairing has timed out. | |
virtual void | on_pairing_completed (connection_handle_t connection)=0 |
Indicate that the pairing for the link has completed. | |
virtual void | on_valid_mic_timeout (connection_handle_t connection)=0 |
Indicate that the authentication timeout time has elapsed and we received no packets with a valid MIC in that time. | |
virtual void | on_slave_security_request (connection_handle_t connection, AuthenticationMask authentication)=0 |
Ask the stack to evaluate the security request received from the slave. | |
virtual void | on_link_encryption_result (connection_handle_t connection, link_encryption_t result)=0 |
Inform the application of the result of an encryption request. | |
virtual void | on_link_encryption_request_timed_out (connection_handle_t connection)=0 |
Indicate that the encryption request failed due to timeout. | |
virtual void | on_passkey_display (connection_handle_t connection, passkey_num_t passkey)=0 |
Inform the application that should display a passkey. | |
virtual void | on_confirmation_request (connection_handle_t connection)=0 |
Indicate that user confirmation is required to confirm matching passkeys displayed on devices. | |
virtual void | on_passkey_request (connection_handle_t connection)=0 |
Request the passkey entered during pairing. | |
virtual void | on_keypress_notification (connection_handle_t connection, Keypress_t keypress)=0 |
Indicate that a key has been pressed by the peer. | |
virtual void | on_legacy_pairing_oob_request (connection_handle_t connection)=0 |
Request OOB data from the user application. | |
virtual void | on_oob_data_verification_request (connection_handle_t connection, const public_key_coord_t &peer_public_key_x, const public_key_coord_t &peer_public_key_y)=0 |
Request OOB data to be verified against received public keys. | |
virtual void | on_public_key_generated (const public_key_coord_t &public_key_x, const public_key_coord_t &public_key_y)=0 |
Provide the local public key. | |
virtual void | on_secure_connections_ltk_generated (connection_handle_t connection, const ltk_t <k)=0 |
Store the results of key generation of the stage 2 of secure connections pairing. | |
virtual void | on_keys_distributed_ltk (connection_handle_t connection, const ltk_t <k)=0 |
Store the results of key distribution after LTK has been received. | |
virtual void | on_keys_distributed_ediv_rand (connection_handle_t connection, const ediv_t &ediv, const rand_t &rand)=0 |
Store the results of key distribution after EDIV and RAND has been received. | |
virtual void | on_keys_distributed_local_ltk (connection_handle_t connection, const ltk_t <k)=0 |
Store the local key, if we are slave now or in the future this will be used to encrypt. | |
virtual void | on_keys_distributed_local_ediv_rand (connection_handle_t connection, const ediv_t &ediv, const rand_t &rand)=0 |
Store the EDIV and RAND that will be used to identify the stored local LTK. | |
virtual void | on_keys_distributed_irk (connection_handle_t connection, const irk_t &irk)=0 |
Store the results of key distribution after IRK has been received. | |
virtual void | on_keys_distributed_bdaddr (connection_handle_t connection, advertising_peer_address_type_t peer_identity_address_type, const address_t &peer_identity_address)=0 |
Store the identity address of the peer after it has been distributed. | |
virtual void | on_keys_distributed_csrk (connection_handle_t connection, const csrk_t &csrk)=0 |
Store the peer's CSRK after it has been distributed. | |
virtual void | on_ltk_request (connection_handle_t connection, const ediv_t &ediv, const rand_t &rand)=0 |
Request the LTK since the peer is asking us to encrypt the link. | |
virtual void | on_ltk_request (connection_handle_t connection)=0 |
Request the LTK since the peer is asking us to encrypt the link. |
Detailed Description
Handle events generated by ble::pal::SecurityManager.
Definition at line 212 of file PalSecurityManager.h.
Member Function Documentation
virtual void on_confirmation_request | ( | connection_handle_t | connection ) | [pure virtual] |
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
virtual void on_keypress_notification | ( | connection_handle_t | connection, |
Keypress_t | keypress | ||
) | [pure virtual] |
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
virtual void on_keys_distributed_bdaddr | ( | connection_handle_t | connection, |
advertising_peer_address_type_t | peer_identity_address_type, | ||
const address_t & | peer_identity_address | ||
) | [pure virtual] |
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
virtual void on_keys_distributed_csrk | ( | connection_handle_t | connection, |
const csrk_t & | csrk | ||
) | [pure virtual] |
Store the peer's CSRK after it has been distributed.
- Parameters:
-
[in] connection connection handle [in] csrk signing key
virtual void on_keys_distributed_ediv_rand | ( | connection_handle_t | connection, |
const ediv_t & | ediv, | ||
const rand_t & | rand | ||
) | [pure virtual] |
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
virtual void on_keys_distributed_irk | ( | connection_handle_t | connection, |
const irk_t & | irk | ||
) | [pure virtual] |
Store the results of key distribution after IRK has been received.
- Parameters:
-
[in] connection connection handle [in] irk identity resolution key
virtual void on_keys_distributed_local_ediv_rand | ( | connection_handle_t | connection, |
const ediv_t & | ediv, | ||
const rand_t & | rand | ||
) | [pure virtual] |
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
virtual void on_keys_distributed_local_ltk | ( | connection_handle_t | connection, |
const ltk_t & | ltk | ||
) | [pure virtual] |
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
virtual void on_keys_distributed_ltk | ( | connection_handle_t | connection, |
const ltk_t & | ltk | ||
) | [pure virtual] |
Store the results of key distribution after LTK has been received.
- Parameters:
-
[in] connection connection handle [in] ltk long term key from the peer
virtual void on_legacy_pairing_oob_request | ( | connection_handle_t | connection ) | [pure virtual] |
Request OOB data from the user application.
- Parameters:
-
[in] connection connection handle
- Note:
- shall be followed by: pal::SecurityManager::legacy_pairing_oob_data_request_reply or a cancellation of the procedure.
virtual void on_link_encryption_request_timed_out | ( | connection_handle_t | connection ) | [pure virtual] |
Indicate that the encryption request failed due to timeout.
- Parameters:
-
[in] connection connection handle
virtual void on_link_encryption_result | ( | connection_handle_t | connection, |
link_encryption_t | result | ||
) | [pure virtual] |
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
virtual void on_ltk_request | ( | connection_handle_t | connection ) | [pure virtual] |
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
virtual void on_ltk_request | ( | connection_handle_t | connection, |
const ediv_t & | ediv, | ||
const rand_t & | rand | ||
) | [pure virtual] |
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
virtual void on_oob_data_verification_request | ( | connection_handle_t | connection, |
const public_key_coord_t & | peer_public_key_x, | ||
const public_key_coord_t & | peer_public_key_y | ||
) | [pure virtual] |
Request OOB data to be verified against received public keys.
- Parameters:
-
[in] public_key_x newly generated public key (x coordinate) [in] public_key_y newly generated public key (y coordinate)
virtual void on_pairing_completed | ( | connection_handle_t | connection ) | [pure virtual] |
Indicate that the pairing for the link has completed.
- Parameters:
-
[in] connection connection handle
virtual void on_pairing_error | ( | connection_handle_t | connection, |
pairing_failure_t | error | ||
) | [pure virtual] |
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
virtual void on_pairing_request | ( | connection_handle_t | connection, |
bool | oob_data_flag, | ||
AuthenticationMask | authentication_requirements, | ||
KeyDistribution | initiator_dist, | ||
KeyDistribution | responder_dist | ||
) | [pure virtual] |
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
virtual void on_pairing_timed_out | ( | connection_handle_t | connection ) | [pure virtual] |
Indicate that the pairing has timed out.
- Parameters:
-
[in] connection connection handle
virtual void on_passkey_display | ( | connection_handle_t | connection, |
passkey_num_t | passkey | ||
) | [pure virtual] |
Inform the application that should display a passkey.
- Parameters:
-
[in] connection connection handle [in] passkey passkey to be displayed
virtual void on_passkey_request | ( | connection_handle_t | connection ) | [pure virtual] |
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.
virtual void on_public_key_generated | ( | const public_key_coord_t & | public_key_x, |
const public_key_coord_t & | public_key_y | ||
) | [pure virtual] |
Provide the local public key.
- Parameters:
-
[in] public_key_x newly generated public key (x coordinate) [in] public_key_y newly generated public key (y coordinate)
virtual void on_secure_connections_ltk_generated | ( | connection_handle_t | connection, |
const ltk_t & | ltk | ||
) | [pure virtual] |
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
virtual void on_slave_security_request | ( | connection_handle_t | connection, |
AuthenticationMask | authentication | ||
) | [pure virtual] |
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
virtual void on_valid_mic_timeout | ( | connection_handle_t | connection ) | [pure virtual] |
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
Generated on Tue Jul 12 2022 12:22:53 by
