pub struct DeviceIdentity { /* private fields */ }Expand description
The device’s own verified identity: its certificate and public key.
Implementations§
Source§impl DeviceIdentity
impl DeviceIdentity
Sourcepub fn load(
store: &impl DeviceStore,
trust: &TrustAnchors,
me: MemberId,
now: UnixMs,
) -> Result<Option<DeviceIdentity>, IdentityError>
pub fn load( store: &impl DeviceStore, trust: &TrustAnchors, me: MemberId, now: UnixMs, ) -> Result<Option<DeviceIdentity>, IdentityError>
Loads and verifies the stored device of this install (own-certificate checks:
member = the signed-in member, key = the device’s own). Ok(None): not enrolled.
Sourcepub fn from_stored(
stored: StoredDevice,
trust: &TrustAnchors,
me: MemberId,
now: UnixMs,
) -> Result<DeviceIdentity, IdentityError>
pub fn from_stored( stored: StoredDevice, trust: &TrustAnchors, me: MemberId, now: UnixMs, ) -> Result<DeviceIdentity, IdentityError>
From a stored device (already verified by Enrollment::accept).
Sourcepub fn install_id(&self) -> u64
pub fn install_id(&self) -> u64
The install.
Sourcepub fn cert_bytes(&self) -> &[u8] ⓘ
pub fn cert_bytes(&self) -> &[u8] ⓘ
The certificate’s TLS bytes.
Sourcepub fn cert(&self) -> &VerifiedCert
pub fn cert(&self) -> &VerifiedCert
The verified certificate.
Sourcepub fn stored(&self) -> &StoredDevice
pub fn stored(&self) -> &StoredDevice
The stored state.
Trait Implementations§
Source§impl Clone for DeviceIdentity
impl Clone for DeviceIdentity
Source§impl Debug for DeviceIdentity
impl Debug for DeviceIdentity
impl Eq for DeviceIdentity
Source§impl PartialEq for DeviceIdentity
impl PartialEq for DeviceIdentity
impl StructuralPartialEq for DeviceIdentity
Auto Trait Implementations§
impl Forget for DeviceIdentity
impl Freeze for DeviceIdentity
impl Move for DeviceIdentity
impl RefUnwindSafe for DeviceIdentity
impl Send for DeviceIdentity
impl Sync for DeviceIdentity
impl Unpin for DeviceIdentity
impl UnsafeUnpin for DeviceIdentity
impl UnwindSafe for DeviceIdentity
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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