pub enum JwsAlgorithm {
Show 16 variants
HS256,
HS384,
HS512,
RS256,
RS384,
RS512,
PS256,
PS384,
PS512,
ES256,
ES384,
ES512,
EdDSA,
Ed25519,
Ed448,
ES256K,
}Expand description
JWS signature algorithm.
Variants§
HS256
HMAC using SHA-256
HS384
HMAC using SHA-384
HS512
HMAC using SHA-512
RS256
RSASSA-PKCS1-v1_5 using SHA-256
RS384
RSASSA-PKCS1-v1_5 using SHA-384
RS512
RSASSA-PKCS1-v1_5 using SHA-512
PS256
RSASSA-PSS using SHA-256
PS384
RSASSA-PSS using SHA-384
PS512
RSASSA-PSS using SHA-512
ES256
ECDSA using P-256 and SHA-256
ES384
ECDSA using P-384 and SHA-384
ES512
ECDSA using P-521 and SHA-512
EdDSA
Legacy curve-dependent EdDSA identifier (Ed25519 or Ed448). Distinct from fully specified names in application algorithm allowlists.
Ed25519
Fully specified Ed25519 identifier (RFC 9864 section 2.2).
Uses the same primitive as Self::EdDSA without aliasing its wire name.
Ed448
Pure Ed448 with an empty context (RFC 9864 section 2.2).
ES256K
ECDSA using secp256k1 and SHA-256
Implementations§
Source§impl JwsAlgorithm
impl JwsAlgorithm
Sourcepub fn to_crypto(self) -> Result<SignatureAlgorithm>
pub fn to_crypto(self) -> Result<SignatureAlgorithm>
Map to the corresponding kryptering signature algorithm.
Returns Err for algorithms that kryptering does not yet support
(ES256K) or that have no meaningful cryptographic operation (None).
Without key context, EdDSA retains its historical Ed25519 mapping.
JWK APIs dispatch it on the key curve; raw Ed448 signers/verifiers also
accept EdDSA. Use exact JOSE enum values for application allowlists.
Sourcepub fn from_str(s: &str) -> Result<Self>
pub fn from_str(s: &str) -> Result<Self>
Parse an exact JOSE alg name, also available through str::parse.
§Errors
Returns JoseError::UnsupportedAlgorithm if this build does not recognize the name.