Skip to main content

MemberIdentity

Struct MemberIdentity 

Source
pub struct MemberIdentity { /* private fields */ }
Expand description

This device’s member: the stable id and every private pair it holds (E1, E11). Identity custody keeps it; the id never derives from the keys. The active pair is the one the last installed binding made current. A self-replacement keeps its candidate here before publishing it, and every pair a kept replacement retired stays held, because copies name the exact credential they open with (§12.1). Which pair may sign is replay’s decision, never this record’s (§12.3).

Implementations§

Source§

impl MemberIdentity

Source

pub fn new(member: MemberId, keys: MemberKeys) -> Self

Bind a private pair to the stable id its admin entry names.

Source

pub fn generate(member: MemberId) -> Result<Self, CryptoError>

Make both key pairs for an independently generated id (§10).

Source

pub fn member(&self) -> MemberId

The stable member id.

Source

pub fn keys(&self) -> &MemberKeys

The active private pair: the one this device signs with and a restore code exports.

Source

pub fn candidate(&self) -> Option<&MemberKeys>

A self-replacement’s fresh pair, kept before its binding is published.

Source

pub fn credential(&self, sealing: &SealingKey) -> Option<&MemberKeys>

The held private pair whose sealing key is sealing. A copy names the exact credential it is sealed to, and opens only with that one, never with whichever pair is latest (§12.1).

Source

pub fn holds(&self, keys: &MemberPublicKeys) -> bool

Whether some held pair is exactly keys.

Source

pub fn with_candidate(&self, candidate: MemberKeys) -> Self

This identity keeping candidate for a self-replacement. A candidate already held stays held as a retired credential: its copies may exist.

Source

pub fn activate(&self, current: &MemberPublicKeys) -> Option<Self>

This identity with the held pair current active, as replay’s current binding selects it (§12.3). The previously active pair and any other candidate stay held as retired credentials. None when no held pair is current.

Source

pub fn retire_candidate(&self) -> Self

This identity with its candidate retired: a replacement that never became current leaves its copies, so its pair stays held (§12.4).

Source

pub fn without_candidate(&self) -> Self

This identity without its candidate: a self-replacement cancelled before reserving anything never sent a copy to it.

Source

pub fn to_secret_bytes(&self) -> SecretBytes

Encode the id and every held private pair for identity custody: the active pair, the retired ones, then the candidate if any. This custody encoding is not a restore code (D13).

Source

pub fn from_secret_bytes(bytes: &[u8]) -> Result<Self, MaterialError>

Restore the id and every held pair from identity custody.

Trait Implementations§

Source§

impl Clone for MemberIdentity

Source§

fn clone(&self) -> MemberIdentity

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for MemberIdentity

Source§

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

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

impl KeyMaterial for MemberIdentity

Source§

const ENTRY: &'static str = "member-keys"

The keychain entry and passphrase file entry it is kept under.
Source§

const FILE: StoreFile = StoreFile::MemberKeys

The store file a passphrase custody seals it in.
Source§

fn to_secret_bytes(&self) -> SecretBytes

Encode it for custody.
Source§

fn from_secret_bytes(bytes: &[u8]) -> Result<Self, MaterialError>

Decode what to_secret_bytes encoded.

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

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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 = 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<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

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