pub struct Keypair { /* private fields */ }Expand description
Private and public keypair used for nodes and cells.
Implementations§
Source§impl Keypair
impl Keypair
pub fn from_libp2p(keypair: libp2p_Keypair) -> Keypair
pub fn generate_ed25519() -> Keypair
pub fn public(&self) -> PublicKey
pub fn algorithm(&self) -> Algorithm
pub fn to_libp2p(&self) -> &libp2p_Keypair
Sourcepub fn sign(&self, msg: &[u8]) -> Result<Vec<u8>, Error>
pub fn sign(&self, msg: &[u8]) -> Result<Vec<u8>, Error>
Sign given message with the keypair.
The verify method on the public key can be used to validate signature.
Sourcepub fn encode_base58_string(&self) -> String
pub fn encode_base58_string(&self) -> String
Encode the keypair into a base58 representation
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Keypair
impl RefUnwindSafe for Keypair
impl Send for Keypair
impl Sync for Keypair
impl Unpin for Keypair
impl UnwindSafe for Keypair
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> 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