pub struct Ed25519Signer { /* private fields */ }Expand description
Ed25519 signer with a clean seed-based API.
Pure Ed25519 — no post-quantum insurance. For new applications that
need quantum resistance, prefer super::hybrid::HybridSigningKeyBundle.
Implementations§
Source§impl Ed25519Signer
impl Ed25519Signer
Sourcepub fn from_secret_key(key: SigningKey) -> Self
pub fn from_secret_key(key: SigningKey) -> Self
Create a signer from an existing Ed25519 secret key.
Sourcepub fn sign(&self, message: &[u8]) -> [u8; 64]
pub fn sign(&self, message: &[u8]) -> [u8; 64]
Sign a message. Returns a 64-byte Ed25519 signature.
Sourcepub fn verify(&self, message: &[u8], signature: &[u8; 64]) -> bool
pub fn verify(&self, message: &[u8], signature: &[u8; 64]) -> bool
Verify a 64-byte Ed25519 signature against this signer’s public key.
Sourcepub fn verify_with_pubkey(
pubkey: &[u8; 32],
message: &[u8],
signature: &[u8; 64],
) -> bool
pub fn verify_with_pubkey( pubkey: &[u8; 32], message: &[u8], signature: &[u8; 64], ) -> bool
Verify a signature against an arbitrary public key.
Sourcepub fn public_key(&self) -> [u8; 32]
pub fn public_key(&self) -> [u8; 32]
Get the 32-byte Ed25519 public key.
Sourcepub fn secret_key(&self) -> [u8; 32]
pub fn secret_key(&self) -> [u8; 32]
Get the 32-byte Ed25519 secret key seed.
Trait Implementations§
Source§impl Clone for Ed25519Signer
impl Clone for Ed25519Signer
Source§fn clone(&self) -> Ed25519Signer
fn clone(&self) -> Ed25519Signer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Ed25519Signer
impl RefUnwindSafe for Ed25519Signer
impl Send for Ed25519Signer
impl Sync for Ed25519Signer
impl Unpin for Ed25519Signer
impl UnsafeUnpin for Ed25519Signer
impl UnwindSafe for Ed25519Signer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more