pub struct ServerPskContextBuilder<'a> { /* private fields */ }
Expand description
Builder for a server-side DTLS encryption context for use with pre-shared keys (PSK).
Implementations§
Source§impl<'a> ServerPskContextBuilder<'a>
impl<'a> ServerPskContextBuilder<'a>
Sourcepub fn new(key: PskKey<'a>) -> Self
pub fn new(key: PskKey<'a>) -> Self
Creates a new context builder with the given key
as the default key to use.
§Implementation details (informative, not covered by semver guarantees)
Providing a raw public key will set psk_info
to the provided key in the underlying
[coap_dtls_spsk_t
] structure.
Sourcepub fn id_key_provider(
self,
id_key_provider: impl ServerPskIdentityKeyProvider<'a> + 'a,
) -> Self
pub fn id_key_provider( self, id_key_provider: impl ServerPskIdentityKeyProvider<'a> + 'a, ) -> Self
Sets the key provider that provides a PSK for a given identity.
§Implementation details (informative, not covered by semver guarantees)
Setting a id_key_provider
will set the validate_id_call_back
of the underlying
[coap_dtls_spsk_t
] to a wrapper function, which will then call the key provider.
Sourcepub fn sni_key_provider(
self,
sni_key_provider: impl ServerPskSniKeyProvider<'a> + 'a,
) -> Self
pub fn sni_key_provider( self, sni_key_provider: impl ServerPskSniKeyProvider<'a> + 'a, ) -> Self
Sets the key provider that provides keys for a SNI provided by a client.
§Implementation details (informative, not covered by semver guarantees)
Setting a sni_key_provider
will set the validate_sni_call_back
of the underlying
[coap_dtls_spsk_t
] to a wrapper function, which will then call the key provider.
Keys returned by the key provider will be stored in the context for at least as long as they are used by the respective session.
Sourcepub fn build(self) -> ServerPskContext<'a>
pub fn build(self) -> ServerPskContext<'a>
Consumes this builder to construct the resulting PSK context.
Source§impl ServerPskContextBuilder<'_>
impl ServerPskContextBuilder<'_>
Sourcepub fn ec_jpake(self, ec_jpake: bool) -> Self
pub fn ec_jpake(self, ec_jpake: bool) -> Self
Enables or disables support for EC JPAKE (RFC 8236) key exchanges in (D)TLS.
Note: At the time of writing (based on libcoap 4.3.5), this is only supported on MbedTLS, enabling EC JPAKE on other DTLS backends has no effect.
§Implementation details (informative, not covered by semver guarantees)
Equivalent to setting ec_jpake
in the underlying [coap_dtls_spsk_t
] structure.