pub struct PrivateKey65(/* private fields */);Expand description
An ML-DSA-65 private key.
Implementations§
Source§impl PrivateKey65
impl PrivateKey65
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) -> PublicKey65
pub fn to_public_key(&self) -> PublicKey65
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: Prehash65) -> Vec<u8>
pub fn sign_prehashed(&self, prehash: Prehash65) -> Vec<u8>
Sign pre-hashed data.
Auto Trait Implementations§
impl Freeze for PrivateKey65
impl RefUnwindSafe for PrivateKey65
impl Send for PrivateKey65
impl Sync for PrivateKey65
impl Unpin for PrivateKey65
impl UnsafeUnpin for PrivateKey65
impl UnwindSafe for PrivateKey65
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