pub struct PublicKey { /* private fields */ }Expand description
Ed25519 public key for signature verification (RFC 8032).
§Verifying a signature
ⓘ
use crypto::curve25519::ed25519::{PublicKey, 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());§Deserializing from bytes
ⓘ
use crypto::curve25519::ed25519::PublicKey;
let bytes = [0u8; 32]; // replace with a real public key
let pub_key = PublicKey::from_bytes(&bytes);Implementations§
Trait Implementations§
impl Eq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnsafeUnpin for PublicKey
impl UnwindSafe for PublicKey
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