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
impl MemberIdentity
Sourcepub fn new(member: MemberId, keys: MemberKeys) -> MemberIdentity
pub fn new(member: MemberId, keys: MemberKeys) -> MemberIdentity
Bind a private pair to the stable id its admin entry names.
Sourcepub fn generate(member: MemberId) -> Result<MemberIdentity, CryptoError>
pub fn generate(member: MemberId) -> Result<MemberIdentity, CryptoError>
Make both key pairs for an independently generated id (§10).
Sourcepub fn keys(&self) -> &MemberKeys
pub fn keys(&self) -> &MemberKeys
The active private pair: the one this device signs with and a restore code exports.
Sourcepub fn candidate(&self) -> Option<&MemberKeys>
pub fn candidate(&self) -> Option<&MemberKeys>
A self-replacement’s fresh pair, kept before its binding is published.
Sourcepub fn credential(&self, sealing: &SealingKey) -> Option<&MemberKeys>
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).
Sourcepub fn holds(&self, keys: &MemberPublicKeys) -> bool
pub fn holds(&self, keys: &MemberPublicKeys) -> bool
Whether some held pair is exactly keys.
Sourcepub fn with_candidate(&self, candidate: MemberKeys) -> MemberIdentity
pub fn with_candidate(&self, candidate: MemberKeys) -> MemberIdentity
This identity keeping candidate for a self-replacement. A candidate
already held stays held as a retired credential: its copies may exist.
Sourcepub fn activate(&self, current: &MemberPublicKeys) -> Option<MemberIdentity>
pub fn activate(&self, current: &MemberPublicKeys) -> Option<MemberIdentity>
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.
Sourcepub fn retire_candidate(&self) -> MemberIdentity
pub fn retire_candidate(&self) -> MemberIdentity
This identity with its candidate retired: a replacement that never became current leaves its copies, so its pair stays held (§12.4).
Sourcepub fn without_candidate(&self) -> MemberIdentity
pub fn without_candidate(&self) -> MemberIdentity
This identity without its candidate: a self-replacement cancelled before reserving anything never sent a copy to it.
Sourcepub fn to_secret_bytes(&self) -> SecretBytes
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).
Sourcepub fn from_secret_bytes(bytes: &[u8]) -> Result<MemberIdentity, MaterialError>
pub fn from_secret_bytes(bytes: &[u8]) -> Result<MemberIdentity, MaterialError>
Restore the id and every held pair from identity custody.
Trait Implementations§
Source§impl Clone for MemberIdentity
impl Clone for MemberIdentity
Source§fn clone(&self) -> MemberIdentity
fn clone(&self) -> MemberIdentity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemberIdentity
impl Debug for MemberIdentity
Source§impl KeyMaterial for MemberIdentity
impl KeyMaterial for MemberIdentity
Source§const ENTRY: &'static str = "member-keys"
const ENTRY: &'static str = "member-keys"
Source§const FILE: StoreFile = StoreFile::MemberKeys
const FILE: StoreFile = StoreFile::MemberKeys
Source§fn to_secret_bytes(&self) -> SecretBytes
fn to_secret_bytes(&self) -> SecretBytes
Source§fn from_secret_bytes(bytes: &[u8]) -> Result<MemberIdentity, MaterialError>
fn from_secret_bytes(bytes: &[u8]) -> Result<MemberIdentity, MaterialError>
to_secret_bytes encoded.Auto Trait Implementations§
impl Freeze for MemberIdentity
impl RefUnwindSafe for MemberIdentity
impl Send for MemberIdentity
impl Sync for MemberIdentity
impl Unpin for MemberIdentity
impl UnsafeUnpin for MemberIdentity
impl UnwindSafe for MemberIdentity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more