Struct ServerPskContextBuilder

Source
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>

Source

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.

Source

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.

Source

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.

Source

pub fn build(self) -> ServerPskContext<'a>

Consumes this builder to construct the resulting PSK context.

Source§

impl ServerPskContextBuilder<'_>

Source

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.

Trait Implementations§

Source§

impl<'a> Debug for ServerPskContextBuilder<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T