pub trait SecurityHandler {
    // Provided methods
    fn io_capabilities(&self) -> IoCapabilities { ... }
    fn can_recv_out_of_band(&self, _conn: &Connection) -> bool { ... }
    fn can_bond(&self, _conn: &Connection) -> bool { ... }
    fn display_passkey(&self, _passkey: &[u8; 6]) { ... }
    fn enter_passkey(&self, _reply: PasskeyReply) { ... }
    fn recv_out_of_band(&self, _reply: OutOfBandReply) { ... }
    fn on_security_update(
        &self,
        _conn: &Connection,
        _security_mode: SecurityMode
    ) { ... }
    fn on_bonded(
        &self,
        _conn: &Connection,
        _master_id: MasterId,
        _key: EncryptionInfo,
        _peer_id: IdentityKey
    ) { ... }
    fn get_key(
        &self,
        _conn: &Connection,
        _master_id: MasterId
    ) -> Option<EncryptionInfo> { ... }
    fn save_sys_attrs(&self, _conn: &Connection) { ... }
    fn load_sys_attrs(&self, conn: &Connection) { ... }
}

Provided Methods§

source

fn io_capabilities(&self) -> IoCapabilities

source

fn can_recv_out_of_band(&self, _conn: &Connection) -> bool

Returns true if the device can receive out-of-band authentication data.

source

fn can_bond(&self, _conn: &Connection) -> bool

Returns true if the device can save bonding keys for _conn

source

fn display_passkey(&self, _passkey: &[u8; 6])

Display passkey to the user for confirmation on the remote device.

Must be implemented if io_capabilities() is one of DisplayOnly, DisplayYesNo, or KeyboardDisplay.

source

fn enter_passkey(&self, _reply: PasskeyReply)

Allow the user to enter a passkey displayed on the remote device.

Must be implemented if io_capabilities() is one of KeyboardOnly or KeyboardDisplay.

source

fn recv_out_of_band(&self, _reply: OutOfBandReply)

Receive out-of-band authentication data.

Must be implemented if can_recv_out_of_band() ever returns true.

source

fn on_security_update(&self, _conn: &Connection, _security_mode: SecurityMode)

Called when the SecurityMode of a Connection has changed.

source

fn on_bonded( &self, _conn: &Connection, _master_id: MasterId, _key: EncryptionInfo, _peer_id: IdentityKey )

The connection has been bonded and its encryption keys should now be stored.

Must be implemented if can_bond ever returns true.

source

fn get_key( &self, _conn: &Connection, _master_id: MasterId ) -> Option<EncryptionInfo>

Search the store for a known peer identified by master_id and return its LTK.

source

fn save_sys_attrs(&self, _conn: &Connection)

Store the GATTS system attributes for conn if a bond exists

source

fn load_sys_attrs(&self, conn: &Connection)

Load the GATTS system attributes for the bond associated with conn

If no system attributes have been stored for this peer, you should call set_sys_attrs with a sys_attrs parameter of None.

Implementors§