pub struct Identity { /* private fields */ }Expand description
This machine’s Ed25519 identity: a secrecy-wrapped seed plus the derived public key.
The seed never leaves the SecretBox except transiently to sign or to be persisted to the
(0600) keyfile; the fmt::Debug impl redacts it.
Implementations§
Source§impl Identity
impl Identity
Sourcepub fn generate() -> Res<Self>
pub fn generate() -> Res<Self>
Generates a fresh identity from operating-system entropy.
§Errors
Returns an error if the OS random source cannot be read or the seed is rejected.
Sourcepub fn from_seed(seed: [u8; 32]) -> Res<Self>
pub fn from_seed(seed: [u8; 32]) -> Res<Self>
Reconstructs an identity from its 32-byte seed.
§Errors
Returns an error if the seed is rejected by the signing backend.
Sourcepub fn public_key(&self) -> [u8; 32]
pub fn public_key(&self) -> [u8; 32]
This identity’s raw 32-byte public key.
Sourcepub fn public_key_base64(&self) -> String
pub fn public_key_base64(&self) -> String
This identity’s public key as a URL-safe base64 string, for display and pasting.
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§
impl<T> AsyncFriendly for T
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request