pub struct SecretKey { /* private fields */ }Available on crate feature
mldsa only.Expand description
SecretKey contains an ML-DSA-65 private key usable for signing.
Implementations§
Source§impl SecretKey
impl SecretKey
Sourcepub fn from_bytes(seed: &[u8; 32]) -> Self
pub fn from_bytes(seed: &[u8; 32]) -> Self
from_bytes creates a private key from a 32-byte seed.
Sourcepub fn from_der(der: &[u8]) -> Result<Self, Box<dyn Error>>
pub fn from_der(der: &[u8]) -> Result<Self, Box<dyn Error>>
from_der parses a DER buffer into a private key.
Sourcepub fn from_pem(pem_str: &str) -> Result<Self, Box<dyn Error>>
pub fn from_pem(pem_str: &str) -> Result<Self, Box<dyn Error>>
from_pem parses a PEM string into a private key.
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
public_key retrieves the public counterpart of the secret key.
Sourcepub fn fingerprint(&self) -> Fingerprint
pub fn fingerprint(&self) -> Fingerprint
fingerprint returns a 256bit unique identified for this key. For ML-DSA, that is the SHA256 hash of the raw public key.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SecretKey
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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