pub struct Identity { /* private fields */ }Implementations§
Source§impl Identity
impl Identity
pub fn generate() -> Result<Self>
pub fn from_secret_bytes(bytes: [u8; 32]) -> Result<Self>
pub fn fingerprint(&self) -> &str
pub fn peer_id(&self) -> PeerId
pub fn keypair(&self) -> &Keypair
pub fn secret_bytes(&self) -> [u8; 32]
pub fn public_bytes(&self) -> [u8; 32]
Sourcepub fn sign(&self, msg: &[u8]) -> [u8; 64]
pub fn sign(&self, msg: &[u8]) -> [u8; 64]
Ed25519-sign msg with our identity key. The signature binds
arbitrary bytes to this fingerprint; used by protocol envelopes
(SignedRoomMessage) so receivers can prove the sender’s identity
at the application layer (gossipsub only proves transport-level).
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