pub struct ClientIdentity { /* private fields */ }Available on crate feature
client only.Expand description
Client identity containing the key pair.
Implementations§
Source§impl ClientIdentity
impl ClientIdentity
Sourcepub fn generate() -> Result<Self, BootstrapError>
pub fn generate() -> Result<Self, BootstrapError>
Generate a new random client identity.
Sourcepub fn from_private_key(private_key: [u8; 32]) -> Result<Self, BootstrapError>
pub fn from_private_key(private_key: [u8; 32]) -> Result<Self, BootstrapError>
Create identity from an existing private key.
Sourcepub fn private_key(&self) -> &[u8; 32]
pub fn private_key(&self) -> &[u8; 32]
Get the private key.
Sourcepub fn public_key(&self) -> &[u8; 32]
pub fn public_key(&self) -> &[u8; 32]
Get the public key.
Trait Implementations§
Source§impl Clone for ClientIdentity
impl Clone for ClientIdentity
Source§fn clone(&self) -> ClientIdentity
fn clone(&self) -> ClientIdentity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ClientIdentity
impl RefUnwindSafe for ClientIdentity
impl Send for ClientIdentity
impl Sync for ClientIdentity
impl Unpin for ClientIdentity
impl UnwindSafe for ClientIdentity
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