Skip to main content

Device

Struct Device 

Source
pub struct Device<'a> { /* private fields */ }
Expand description

Borrowed installation keys, matched against membership before signing.

Implementations§

Source§

impl<'a> Device<'a>

Source

pub fn seed(seed: &'a SeedAuthority) -> Self

Source

pub fn validate(&self, membership: &Membership) -> Result<()>

Source

pub fn prepare_invitation( &self, membership: &Membership, expiry: u64, ) -> Result<(Invitation, Declaration)>

Source

pub fn prepare_admission( &self, membership: &Membership, declaration: &Declaration, invitation: &Invitation, request: &[u8], keys: &VerifiedKeys, ) -> Result<Vec<u8>>

Prepare once and retain the exact returned bytes before any dispatch. Repreparation is a different candidate, not an exact retry.

Source§

impl Device<'_>

Source

pub fn prepare_revoke( &self, m: &Membership, targets: &[[u8; 32]], ) -> Result<Vec<u8>>

Sorted active targets; an empty list requests rotation without removal. Exact bytes must be retained before dispatch. No server commit is implied.

Source

pub fn prepare_rotation_with( &self, m: &Membership, keys: &VerifiedKeys, cutoff: u64, material: &RotationMaterial, ) -> Result<Vec<u8>>

Replay one protected candidate. Encapsulation randomness is bound to the predecessor, signer, and cutoff, so retries are byte-identical while a changed context gets independent HPKE encapsulations. Replacements still require fresh material for independent generation keys.

Source

pub fn receive_rotation( &self, before: &Membership, raw: &[u8], keys: &VerifiedKeys, ) -> Result<VerifiedKeys>

Validates the entire transition and own package before yielding full coverage. Other recipients’ encrypted plaintext cannot be validated by this device.

Auto Trait Implementations§

§

impl<'a> Freeze for Device<'a>

§

impl<'a> RefUnwindSafe for Device<'a>

§

impl<'a> Send for Device<'a>

§

impl<'a> Sync for Device<'a>

§

impl<'a> Unpin for Device<'a>

§

impl<'a> UnsafeUnpin for Device<'a>

§

impl<'a> UnwindSafe for Device<'a>

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.