The Peer Manager consists of the following modules:
When the application or a connected peer device requests a secured link, the Security Manager & Dispatcher is responsible for handling the required procedure. It interfaces with the SoftDevice in creating the secured connection, stores and retrieves the exchanged keys, and manages the pairing procedure.
The module consists of two parts: the Security Manager and the Security Dispatcher. The Security Manager stores security parameters, keeps track of the current state, and coordinates the pairing procedure. The Security Dispatcher interfaces with the SoftDevice and the flash to do the actual pairing.
sdk_config.h
file. In this mode, the Peer Manager handles internally all requests for Diffie-Hellman keys from the SoftDevice. When PM_LESC_ENABLED is true, it is necessary to call nrf_ble_lesc_request_handler function in the main context of the application. If there is any pending DH key request, the function will calculate the requested key and provide it to the SoftDevice. sdk_config.h
file. In this mode, the Peer Manager uses the timing module to keep track of peer devices that failed at the pairing procedure. Future pairing attempts from these peer devices are rejected for a certain period of time. More detailed description of peer tracking policy can be found in Bluetooth Core Specification v5.0, Vol 3, Part H, Section 2.3.6. The ID Manager keeps track of connected peers and identifies them based on different kinds of IDs: the static device address, master ID, Identity Resolving Key (IRK), IRK whitelist index, and peer ID. It detects if different IDs refer to the same peer and determines which of the connected peers are bonded. When a bonded device is connected, the application can ask for the connection handle associated with the peer ID (or the other way around).
In addition, the ID Manager creates and maintains whitelists.
See Experimental: Flash Data Storage for detailed information about the Flash Data Storage module.