pub enum SignatureAlgorithm {
MlDsa87,
EcdsaP256Sha256,
EcdsaP384Sha384,
EcdsaP521Sha384,
EcdsaP521Sha512,
Ed25519,
Rsa2048Sha384,
Rsa3072Sha384,
Rsa4096Sha384,
}Expand description
A signature key algorithm: what a key is generated as, and what its CSR is signed with.
Variants§
MlDsa87
ML-DSA-87 (FIPS 204).
EcdsaP256Sha256
ECDSA on P-256 with SHA-256.
EcdsaP384Sha384
ECDSA on P-384 with SHA-384.
EcdsaP521Sha384
ECDSA on P-521 with SHA-384.
EcdsaP521Sha512
ECDSA on P-521 with SHA-512.
Ed25519
Ed25519 (FIPS 186-5 EdDSA).
Rsa2048Sha384
A 2048-bit RSA key; its CSR is signed RSASSA-PKCS1-v1_5 with SHA-384.
Rsa3072Sha384
A 3072-bit RSA key; its CSR is signed RSASSA-PKCS1-v1_5 with SHA-384.
Rsa4096Sha384
A 4096-bit RSA key; its CSR is signed RSASSA-PKCS1-v1_5 with SHA-384.
Implementations§
Source§impl SignatureAlgorithm
impl SignatureAlgorithm
Sourcepub const ALL: [SignatureAlgorithm; 9]
pub const ALL: [SignatureAlgorithm; 9]
Every signature key algorithm.
Sourcepub const fn signature_oid(self) -> &'static str
pub const fn signature_oid(self) -> &'static str
The X.509 signature-algorithm OID a CSR or certificate signed by this key carries (RFC 5758, RFC 8410, RFC 4055, and draft-ietf-lamps-dilithium-certificates for ML-DSA).
Sourcepub const fn tls_scheme(self) -> TlsSignatureScheme
pub const fn tls_scheme(self) -> TlsSignatureScheme
The TLS signature scheme this crate pairs with a key of this algorithm: the scheme the key signs a handshake with when the peer offers this scheme alone.
An ECDSA, Ed25519 or ML-DSA key has no other scheme. An RSA key’s scheme comes from the
peer’s offer, whatever the key’s CSR was signed with: rustls signs with the first of RSA-PSS
with SHA-512, SHA-384 and SHA-256, then PKCS#1 v1.5 with SHA-512, SHA-384 and SHA-256, that
the peer offers (RSA_SCHEMES in crypto-profile/src/provider/sign.rs, the order rustls
0.23.46 uses), and TLS 1.3 admits only the RSA-PSS ones (src/enums.rs:554-579). So an RSA
key signs with RSA-PSS with SHA-384 only when the peer offers it and does not offer RSA-PSS
with SHA-512.