Skip to main content

RootSet

Struct RootSet 

Source
pub struct RootSet {
    pub ever: Vec<RootKey>,
    pub removed: Vec<(RootKey, i64)>,
    pub members: Vec<RootKey>,
}
Expand description

The roots that may act for an identity, as a verifier works them out from its genesis and every valid state it holds:

  • ever: the genesis’s roots, and every root added by one in ever, until nothing more is added. A state counts only if one of these signed it.
  • removed: every root a state signed by one in ever removes, at its earliest removed_at. Removal never lapses: a removed root never comes back.
  • members: the genesis’s roots, and every root added by a member no later than that member’s own removal (added_at at or before its removed_at: times are whole seconds, and a rotation adds the new key and drops the old one in the same one), until nothing more is added; then without the removed. A credential counts only from a member.

So a root added by a key later rotated out stays, and one a removed key adds after its removal does not. Times are the roots’ own word: a stolen key that backdates an addition is stopped where its removal arrived first, by the verifier refusing the state that brings it (the server, and the SDK’s accept_state). A removed root’s removals still count, so two roots that remove each other are both gone: the identity is locked rather than taken.

Fields§

§ever: Vec<RootKey>§removed: Vec<(RootKey, i64)>§members: Vec<RootKey>

Implementations§

Source§

impl RootSet

Source

pub fn of(genesis: &[RootKey], states: &[RootChanges<'_>]) -> Self

The set genesis begins and states change.

Source

pub fn holds(&self, root: &RootKey) -> bool

Whether root may act now: a member, not removed.

Source

pub fn knew(&self, root: &RootKey) -> bool

Whether root was ever one of the identity’s: a state it signed is taken in, for its removals.

Source

pub fn is_removed(&self, root: &RootKey) -> bool

Whether root is removed.

Source

pub fn refuses_additions(&self, added: &[AddedRoot]) -> bool

Whether added, arriving now, adds a root this set does not know whose adder this set has already removed: an addition that came after the removal, whatever time it claims. A verifier refuses the state that brings it, so a stolen key cannot backdate its way past a removal the verifier already holds.

Trait Implementations§

Source§

impl Clone for RootSet

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RootSet

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for RootSet

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for RootSet

Source§

impl PartialEq for RootSet

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RootSet

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.