pub struct MLDSA44KeyPair { /* private fields */ }Implementations§
Source§impl MLDSA44KeyPair
impl MLDSA44KeyPair
pub fn from_bytes(raw: &[u8]) -> Result<Self, Error>
pub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn public_key(&self) -> MLDSA44PublicKey
pub fn generate() -> Self
pub fn with_key_id(self, key_id: &str) -> Self
Sourcepub fn from_jwk(jwk: &str) -> Result<Self, Error>
pub fn from_jwk(jwk: &str) -> Result<Self, Error>
Import a key pair from a private AKP JWK, with alg: ML-DSA-44.
priv must contain the 32-byte seed used by from_bytes().
See strict JWK validation for the other rules.
Sourcepub fn to_jwk(&self) -> String
pub fn to_jwk(&self) -> String
Export the key pair as a JWK, private key included.
Use public_key().to_jwk() to share the public key.
Sourcepub fn jwk_thumbprint(&self) -> String
pub fn jwk_thumbprint(&self) -> String
The JWK thumbprint of the public key, which includes its algorithm.
Trait Implementations§
Source§impl Clone for MLDSA44KeyPair
impl Clone for MLDSA44KeyPair
Source§impl Debug for MLDSA44KeyPair
impl Debug for MLDSA44KeyPair
Source§impl MLDSAKeyPairLike for MLDSA44KeyPair
impl MLDSAKeyPairLike for MLDSA44KeyPair
fn jwt_alg_name() -> &'static str
fn key_pair(&self) -> &MLDSAKeyPair
fn key_id(&self) -> &Option<String>
fn metadata(&self) -> &Option<KeyMetadata>
fn attach_metadata(&mut self, metadata: KeyMetadata) -> Result<(), Error>
fn sign<CustomClaims: Serialize>( &self, claims: JWTClaims<CustomClaims>, ) -> Result<String, Error>
fn sign_with_options<CustomClaims: Serialize>( &self, claims: JWTClaims<CustomClaims>, opts: &HeaderOptions, ) -> Result<String, Error>
Auto Trait Implementations§
impl Freeze for MLDSA44KeyPair
impl RefUnwindSafe for MLDSA44KeyPair
impl Send for MLDSA44KeyPair
impl Sync for MLDSA44KeyPair
impl Unpin for MLDSA44KeyPair
impl UnsafeUnpin for MLDSA44KeyPair
impl UnwindSafe for MLDSA44KeyPair
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