pub struct Identity { /* private fields */ }Expand description
Long-term identity. Holds the signing key only on the originating device.
Implementations§
Source§impl Identity
impl Identity
pub fn generate() -> Self
pub fn user_id(&self) -> &UserId
pub fn public_key(&self) -> VerifyingKey
Sourcepub fn sign_device_binding(&self, device_id: &[u8]) -> Vec<u8> ⓘ
pub fn sign_device_binding(&self, device_id: &[u8]) -> Vec<u8> ⓘ
Sign a (user_id || device_id) binding to issue a device credential.
pub fn verify_device_binding( user_pk: &VerifyingKey, user_id: &UserId, device_id: &[u8], sig: &[u8], ) -> Result<()>
Sourcepub fn export(&self) -> Zeroizing<Vec<u8>>
pub fn export(&self) -> Zeroizing<Vec<u8>>
Export the identity for backup. The returned bytes contain the secret seed and must be treated as such by the caller.
pub fn import(bytes: &[u8]) -> Result<Self>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnsafeUnpin for Identity
impl UnwindSafe for Identity
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
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