pub enum DigestAlgorithm {
Sha1,
Sha224,
Sha256,
Sha384,
Sha512,
Sha3_224,
Sha3_256,
Sha3_384,
Sha3_512,
}Expand description
Digest algorithms supported by XMLDSig.
SHA-1 is disabled for signing by default and requires explicit policy opt-in. SHA-256 is the recommended default for new signatures.
Variants§
Sha1
SHA-1 (160-bit). Disabled for signing by default.
Sha224
SHA-224 (224-bit), required by XMLDSig 1.1 interoperability profiles.
Sha256
SHA-256 (256-bit). Default for SAML.
Sha384
SHA-384 (384-bit).
Sha512
SHA-512 (512-bit).
Sha3_224
SHA3-224 (224-bit).
Sha3_256
SHA3-256 (256-bit).
Sha3_384
SHA3-384 (384-bit).
Sha3_512
SHA3-512 (512-bit).
Implementations§
Source§impl DigestAlgorithm
impl DigestAlgorithm
Sourcepub const ALL: [Self; 9]
pub const ALL: [Self; 9]
Every compiled digest capability; this registry grants no policy permission.
Sourcepub fn from_uri(uri: &str) -> Option<Self>
pub fn from_uri(uri: &str) -> Option<Self>
Parse a digest algorithm from its XML namespace URI.
Returns None for unrecognized URIs.
Recognition is capability, not permission: operation callers must check
their compiled digest policy before hashing, including X509Digest selectors.
§URIs
| Algorithm | URI |
|---|---|
| SHA-1 | http://www.w3.org/2000/09/xmldsig#sha1 |
| SHA-224 | http://www.w3.org/2001/04/xmldsig-more#sha224 |
| SHA-256 | http://www.w3.org/2001/04/xmlenc#sha256 |
| SHA-384 | http://www.w3.org/2001/04/xmldsig-more#sha384 |
| SHA-512 | http://www.w3.org/2001/04/xmlenc#sha512 |
Sourcepub fn signing_allowed(self) -> bool
pub fn signing_allowed(self) -> bool
Whether this algorithm is allowed for signing (not just verification).
SHA-1 is deprecated and disabled by secure signing defaults. An explicit signing policy allowlist can enable it for a trusted compatibility boundary.
Sourcepub const fn requires_explicit_permission(self) -> bool
pub const fn requires_explicit_permission(self) -> bool
Whether reference verification requires an explicit digest allowlist entry.
Sourcepub fn output_len(self) -> usize
pub fn output_len(self) -> usize
The expected output length in bytes.