pub struct KeyPair { /* private fields */ }Expand description
Ed25519 key pair for signing and identity
Implementations§
Source§impl KeyPair
impl KeyPair
Sourcepub fn public_key(&self) -> VerifyingKey
pub fn public_key(&self) -> VerifyingKey
Get the public (verifying) key
Sourcepub fn public_key_bytes(&self) -> [u8; 32]
pub fn public_key_bytes(&self) -> [u8; 32]
Get the public key as bytes
Sourcepub fn verify(&self, message: &[u8], signature: &[u8; 64]) -> CryptoResult<()>
pub fn verify(&self, message: &[u8], signature: &[u8; 64]) -> CryptoResult<()>
Verify a signature
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Self
pub fn from_bytes(bytes: &[u8; 32]) -> Self
Import from signing key bytes
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