Skip to main content

ChannelContext

Struct ChannelContext 

Source
pub struct ChannelContext<'a, C: Config, const N: usize, K: KeyStore, R: Rng> {
    pub fabrics: &'a RefCell<FabricTable<C, N>>,
    pub keys: &'a RefCell<K>,
    pub rng: &'a R,
    pub window: &'a RefCell<CommissioningWindow>,
    pub verifier: &'a Spake2pVerifierData,
    pub parameters: &'a PbkdfParameters,
    pub now: Instant,
}
Available on crate feature rustcrypto only.
Expand description

What the node brings to a handshake: its credentials, its randomness and its clock.

Borrowed rather than owned, and per call rather than per channel, because every one of these belongs to the node and outlives any one handshake — and because a Channel that owned them would need six type parameters to say so.

Fields§

§fabrics: &'a RefCell<FabricTable<C, N>>

The fabrics AddNOC created, which is what CASE resolves a destination identifier against.

§keys: &'a RefCell<K>

Where private keys live: the key store is the platform’s, never this crate’s.

§rng: &'a R

The only source of randomness the handshakes have.

§window: &'a RefCell<CommissioningWindow>

The commissioning window, which decides whether PASE runs against the factory verifier or an administrator’s (§11.19.8.1), and which closes after twenty failures.

§verifier: &'a Spake2pVerifierData

The factory SPAKE2+ verifier, derived from the printed passcode at manufacture.

§parameters: &'a PbkdfParameters

The PBKDF parameters that verifier was derived with.

§now: Instant

Now. Nothing in this crate reads a clock for itself, so the caller says what time it is.

Auto Trait Implementations§

§

impl<'a, C, const N: usize, K, R> !RefUnwindSafe for ChannelContext<'a, C, N, K, R>

§

impl<'a, C, const N: usize, K, R> !Send for ChannelContext<'a, C, N, K, R>

§

impl<'a, C, const N: usize, K, R> !Sync for ChannelContext<'a, C, N, K, R>

§

impl<'a, C, const N: usize, K, R> !UnwindSafe for ChannelContext<'a, C, N, K, R>

§

impl<'a, C, const N: usize, K, R> Forget for ChannelContext<'a, C, N, K, R>

§

impl<'a, C, const N: usize, K, R> Freeze for ChannelContext<'a, C, N, K, R>
where &'a RefCell<FabricTable<C, N>>: Freeze, &'a RefCell<K>: Freeze, &'a R: Freeze,

§

impl<'a, C, const N: usize, K, R> Move for ChannelContext<'a, C, N, K, R>

§

impl<'a, C, const N: usize, K, R> Unpin for ChannelContext<'a, C, N, K, R>
where &'a RefCell<FabricTable<C, N>>: Unpin, &'a RefCell<K>: Unpin, &'a R: Unpin,

§

impl<'a, C, const N: usize, K, R> UnsafeUnpin for ChannelContext<'a, C, N, K, R>

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.