Trait ServerPskIdentityKeyProvider

Source
pub trait ServerPskIdentityKeyProvider<'a>: Debug {
    // Required method
    fn key_for_identity(
        &self,
        identity: &[u8],
        session: &CoapServerSession<'_>,
    ) -> Option<PskKey<'a>>;
}
Expand description

Trait for types that can provide pre-shared keys for a key identity given by a client to a server.

Required Methods§

Source

fn key_for_identity( &self, identity: &[u8], session: &CoapServerSession<'_>, ) -> Option<PskKey<'a>>

Provides the key for the key identity given by the client that is connected through session, or None if the identity unacceptable or no key is available.

Implementors§

Source§

impl<'a, T> ServerPskIdentityKeyProvider<'a> for T
where T: AsRef<[PskKey<'a>]> + Debug,