pub enum KeyAlgorithm {
Rsa,
EcdsaP256,
EcdsaP384,
MlDsa44,
MlDsa65,
MlDsa87,
MlKem512,
MlKem768,
MlKem1024,
Unknown(String),
}Expand description
Key algorithm detected from SubjectPublicKeyInfo in a CSR.
Per RFC 2986 §4.1, the SubjectPublicKeyInfo field contains an AlgorithmIdentifier that specifies the key algorithm and any algorithm-specific parameters (e.g., named curves for ECDSA).
Variants§
Rsa
RSA (OID 1.2.840.113549.1.1.1).
EcdsaP256
ECDSA P-256 (OID 1.2.840.10045.2.1 + namedCurve 1.2.840.10045.3.1.7).
EcdsaP384
ECDSA P-384 (OID 1.2.840.10045.2.1 + namedCurve 1.3.132.0.34).
MlDsa44
ML-DSA-44 (OID 2.16.840.1.101.3.4.3.17) per FIPS 204.
MlDsa65
ML-DSA-65 (OID 2.16.840.1.101.3.4.3.18) per FIPS 204.
MlDsa87
ML-DSA-87 (OID 2.16.840.1.101.3.4.3.19) per FIPS 204.
MlKem512
ML-KEM-512 (OID 2.16.840.1.101.3.4.4.1) per FIPS 203.
MlKem768
ML-KEM-768 (OID 2.16.840.1.101.3.4.4.2) per FIPS 203.
MlKem1024
ML-KEM-1024 (OID 2.16.840.1.101.3.4.4.3) per FIPS 203.
Unknown(String)
Unknown algorithm with the given OID string.
Implementations§
Source§impl KeyAlgorithm
impl KeyAlgorithm
Sourcepub fn from_oid(oid: &str) -> Self
pub fn from_oid(oid: &str) -> Self
Parse a key algorithm from its OID string.
For EC keys, the caller must also supply the named curve OID
via KeyAlgorithm::from_ec_oid.
Sourcepub fn from_ec_oid(curve_oid: &str) -> Self
pub fn from_ec_oid(curve_oid: &str) -> Self
Refine an EC public key algorithm using the named curve OID.
Per RFC 5480 §2.1.1, the AlgorithmIdentifier for EC keys includes the namedCurve parameter that identifies the specific curve.
Trait Implementations§
Source§impl Clone for KeyAlgorithm
impl Clone for KeyAlgorithm
Source§fn clone(&self) -> KeyAlgorithm
fn clone(&self) -> KeyAlgorithm
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more