pub struct SecretKey { /* private fields */ }Expand description
Ed25519 signing key (RFC 8032).
§Generating a key
ⓘ
use crypto::curve25519::ed25519::SecretKey;
let priv_key = SecretKey::generate();
let pub_key = priv_key.public_key();§Signing and verification
ⓘ
use crypto::curve25519::ed25519::SecretKey;
let priv_key = SecretKey::generate();
let pub_key = priv_key.public_key();
let sig = priv_key.sign(b"message");
assert!(pub_key.verify(b"message", &sig).is_ok());Implementations§
Trait Implementations§
impl Eq for SecretKey
impl StructuralPartialEq for SecretKey
Auto Trait Implementations§
impl Freeze for SecretKey
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnsafeUnpin for SecretKey
impl UnwindSafe for SecretKey
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