pub struct PrivateKey87(/* private fields */);Expand description
An ML-DSA-87 private key.
Implementations§
Source§impl PrivateKey87
impl PrivateKey87
Sourcepub fn generate() -> (Vec<u8>, Self, [u8; 32])
pub fn generate() -> (Vec<u8>, Self, [u8; 32])
Generates a random public/private key pair returning a serialized public key, a private key, and a private seed value that can be used to regenerate the same private key in the future.
Sourcepub fn to_public_key(&self) -> PublicKey87
pub fn to_public_key(&self) -> PublicKey87
Derives the public key corresponding to this private key.
Sourcepub fn sign_with_context(&self, msg: &[u8], context: &[u8]) -> Option<Vec<u8>>
pub fn sign_with_context(&self, msg: &[u8], context: &[u8]) -> Option<Vec<u8>>
Signs a message using this private key and the given context.
This function returns None if context is longer than 255 bytes.
Sourcepub fn sign_prehashed(&self, prehash: Prehash87) -> Vec<u8>
pub fn sign_prehashed(&self, prehash: Prehash87) -> Vec<u8>
Sign pre-hashed data.
Auto Trait Implementations§
impl Freeze for PrivateKey87
impl RefUnwindSafe for PrivateKey87
impl Send for PrivateKey87
impl Sync for PrivateKey87
impl Unpin for PrivateKey87
impl UnsafeUnpin for PrivateKey87
impl UnwindSafe for PrivateKey87
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