pub enum SigningKey {
Ed25519(Box<SigningKey>),
MlDsa44((Box<MLDSA44SigningKey>, Hash)),
MlDsa65((Box<MLDSA65SigningKey>, Hash)),
MlDsa87((Box<MLDSA87SigningKey>, Hash)),
}Expand description
Private key for creating digital signatures supporting multiple algorithms.
This enum provides a unified interface for signing messages across different cryptographic algorithms, supporting both classical and post-quantum schemes.
§Security Considerations
- Keep private keys secure: Never transmit or store signing keys in plaintext
- Use appropriate key sizes: ML-DSA keys are larger but provide post-quantum security
- Match key types: Ensure the signing key matches the expected verifying key type
§Examples
use zoe_wire_protocol::{KeyPair, SigningKey, VerifyingKey};
use rand::rngs::OsRng;
// Generate a keypair
let keypair = KeyPair::generate(&mut OsRng);
// Sign a message
let message = b"Important message";
let signature = keypair.sign(message);
// Verify with corresponding public key
let verifying_key = keypair.public_key();
let is_valid = verifying_key.verify(message, &signature)?;
assert!(is_valid);Variants§
Ed25519(Box<SigningKey>)
Ed25519 private key (32 bytes)
MlDsa44((Box<MLDSA44SigningKey>, Hash))
ML-DSA-44 private key - for TLS certificates
MlDsa65((Box<MLDSA65SigningKey>, Hash))
ML-DSA-65 private key - for message signatures
MlDsa87((Box<MLDSA87SigningKey>, Hash))
ML-DSA-87 private key - for high security
Implementations§
Trait Implementations§
Source§impl Clone for SigningKey
impl Clone for SigningKey
Source§fn clone(&self) -> SigningKey
fn clone(&self) -> SigningKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SigningKey
impl Debug for SigningKey
Source§impl PartialEq for SigningKey
impl PartialEq for SigningKey
Auto Trait Implementations§
impl Freeze for SigningKey
impl RefUnwindSafe for SigningKey
impl Send for SigningKey
impl Sync for SigningKey
impl Unpin for SigningKey
impl UnwindSafe for SigningKey
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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