Trait CoapServerCryptoProvider

Source
pub trait CoapServerCryptoProvider: Debug {
    // Required method
    fn provide_default_info(&mut self) -> CoapCryptoPskInfo;

    // Provided methods
    fn provide_key_for_identity(
        &mut self,
        identity: &CoapCryptoPskIdentity,
    ) -> CoapCryptoProviderResponse<Box<CoapCryptoPskData>> { ... }
    fn provide_hint_for_sni(
        &mut self,
        sni: &str,
    ) -> CoapCryptoProviderResponse<CoapCryptoPskInfo> { ... }
}

Required Methods§

Source

fn provide_default_info(&mut self) -> CoapCryptoPskInfo

Provide the default PSK identity hint and key data that should be used for new server-side sessions.

Return a CoapCryptoProviderResponse corresponding to the cryptographic information that should be used.

Provided Methods§

Source

fn provide_key_for_identity( &mut self, identity: &CoapCryptoPskIdentity, ) -> CoapCryptoProviderResponse<Box<CoapCryptoPskData>>

Provide the appropiate cryptographic information for the given key identity supplied by the client.

Return a CoapCryptoProviderResponse corresponding to the cryptographic information that should be used.

Source

fn provide_hint_for_sni( &mut self, sni: &str, ) -> CoapCryptoProviderResponse<CoapCryptoPskInfo>

Provide the appropriate key hint and data for the given SNI provided by the client.

This function will only be called once per SNI hint, libcoap will remember the returned hint.

Return None if the provided SNI is unacceptable, i.e. you have no key for this server name.

Note: Unsupported by the TinyDTLS DTLS backend.

Implementors§