#[non_exhaustive]pub enum SignatureAlgorithm {
Show 13 variants
EcdsaP256Sha256,
EcdsaP384Sha384,
EcdsaP521Sha512,
Ed25519,
RsaPkcs1Sha256,
RsaPkcs1Sha384,
RsaPkcs1Sha512,
RsaPssSha256,
RsaPssSha384,
RsaPssSha512,
MlDsa44,
MlDsa65,
MlDsa87,
}Expand description
A signature algorithm: the key type and everything that goes with it.
Each names one entry in the ontology, by SignatureAlgorithm::id. RSA
keys serve several of these; every other key serves exactly one.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EcdsaP256Sha256
ECDSA over P-256 with SHA-256.
EcdsaP384Sha384
ECDSA over P-384 with SHA-384.
EcdsaP521Sha512
ECDSA over P-521 with SHA-512.
Ed25519
Ed25519.
RsaPkcs1Sha256
RSASSA-PKCS1-v1_5 with SHA-256.
RsaPkcs1Sha384
RSASSA-PKCS1-v1_5 with SHA-384.
RsaPkcs1Sha512
RSASSA-PKCS1-v1_5 with SHA-512.
RsaPssSha256
RSASSA-PSS with SHA-256, MGF1-SHA-256 and a 32-byte salt.
RsaPssSha384
RSASSA-PSS with SHA-384, MGF1-SHA-384 and a 48-byte salt.
RsaPssSha512
RSASSA-PSS with SHA-512, MGF1-SHA-512 and a 64-byte salt.
MlDsa44
ML-DSA-44 (FIPS 204), pure, with an empty context.
MlDsa65
ML-DSA-65 (FIPS 204), pure, with an empty context.
MlDsa87
ML-DSA-87 (FIPS 204), pure, with an empty context.
Implementations§
Source§impl SignatureAlgorithm
impl SignatureAlgorithm
Sourcepub const ALL: &'static [SignatureAlgorithm]
pub const ALL: &'static [SignatureAlgorithm]
Every algorithm, for callers that enumerate them.
Sourcepub fn from_id(id: &str) -> Option<Self>
pub fn from_id(id: &str) -> Option<Self>
The algorithm an ontology identifier names, if it is one of these.
Sourcepub const fn max_signature_len(self) -> usize
pub const fn max_signature_len(self) -> usize
The longest signature the algorithm produces, in the encoding this module’s interface uses: a buffer this long always suffices.
ECDSA is the DER Ecdsa-Sig-Value, whose length varies with the
leading bits of r and s. RSA is for the largest modulus this
library accepts, 4096 bits.