pub struct Keypair { /* private fields */ }Expand description
Ed25519 keypair for signing
Implementations§
Source§impl Keypair
impl Keypair
Sourcepub fn generate() -> Self
pub fn generate() -> Self
Generate a new random keypair.
§Examples
use hush_core::Keypair;
let keypair = Keypair::generate();
let pubkey = keypair.public_key();
assert_eq!(pubkey.as_bytes().len(), 32);Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Get the public key
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 UnsafeUnpin 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