pub struct OscoreEdhocHandler<H: Handler, Crypto: Crypto, CryptoFactory: Fn() -> Crypto, SSC: ServerSecurityConfig, RNG: RngCore + CryptoRng, TP: TimeProvider> { /* private fields */ }Expand description
A CoAP handler wrapping inner resources, and adding EDHOC, OSCORE and ACE support.
While the ACE (authz-info) and EDHOC parts could be implemented as a handler that is to be added into the tree, the OSCORE part needs to wrap the inner handler anyway, and EDHOC and OSCORE are intertwined rather strongly in processing the EDHOC option.
Implementations§
Source§impl<H: Handler, Crypto: Crypto, CryptoFactory: Fn() -> Crypto, SSC: ServerSecurityConfig, RNG: RngCore + CryptoRng, TP: TimeProvider> OscoreEdhocHandler<H, Crypto, CryptoFactory, SSC, RNG, TP>
impl<H: Handler, Crypto: Crypto, CryptoFactory: Fn() -> Crypto, SSC: ServerSecurityConfig, RNG: RngCore + CryptoRng, TP: TimeProvider> OscoreEdhocHandler<H, Crypto, CryptoFactory, SSC, RNG, TP>
Sourcepub fn new(
inner: H,
authorities: SSC,
crypto_factory: CryptoFactory,
rng: RNG,
time: TP,
) -> Self
pub fn new( inner: H, authorities: SSC, crypto_factory: CryptoFactory, rng: RNG, time: TP, ) -> Self
Creates a new CoAP server implementation (a [Handler][coap_handler::Handler]), wrapping an inner (application) handler.
The main configuration is passed in as authorities; the seccfg module
has suitable implementations.
The time provider is used to evaluate any time limited tokens leniently; choosing a “bad”
time source here (in particular crate::time::TimeUnknown) leads to acceptance of expired
tokens.
rng and crypto_factory are used to pass in platform specific implementations of what
may be accelerated by hardware or reuse operating system infrastructure. Any CSPRNG is
suitable for rng (Ariel OS picks rand_chacha::ChaCha20Rng at the time of writing); the
crypto factory can come from the lakers_crypto_rustcrypto::Crypto or any more specialized
hardware based implementation.
Trait Implementations§
Source§impl<H: Handler, Crypto: Crypto, CryptoFactory: Fn() -> Crypto, SSC: ServerSecurityConfig, RNG: RngCore + CryptoRng, TP: TimeProvider> Handler for OscoreEdhocHandler<H, Crypto, CryptoFactory, SSC, RNG, TP>
impl<H: Handler, Crypto: Crypto, CryptoFactory: Fn() -> Crypto, SSC: ServerSecurityConfig, RNG: RngCore + CryptoRng, TP: TimeProvider> Handler for OscoreEdhocHandler<H, Crypto, CryptoFactory, SSC, RNG, TP>
Source§type RequestData = OrInner<OwnRequestData<Result<<H as Handler>::RequestData, <H as Handler>::ExtractRequestError>>, AuthorizationChecked<<H as Handler>::RequestData>>
type RequestData = OrInner<OwnRequestData<Result<<H as Handler>::RequestData, <H as Handler>::ExtractRequestError>>, AuthorizationChecked<<H as Handler>::RequestData>>
Source§type ExtractRequestError = OrInner<Error, <H as Handler>::ExtractRequestError>
type ExtractRequestError = OrInner<Error, <H as Handler>::ExtractRequestError>
extract_request_data(). Read more