pub enum DigestAlgorithm {
Sha1,
Sha256,
Sha384,
Sha512,
}Expand description
Digest algorithms supported by XMLDSig.
SHA-1 is supported for verification only (legacy interop with older IdPs). SHA-256 is the recommended default for new signatures.
Variants§
Sha1
SHA-1 (160-bit). Verify-only — signing with SHA-1 is deprecated.
Sha256
SHA-256 (256-bit). Default for SAML.
Sha384
SHA-384 (384-bit).
Sha512
SHA-512 (512-bit).
Implementations§
Source§impl DigestAlgorithm
impl DigestAlgorithm
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.
§URIs
| Algorithm | URI |
|---|---|
| SHA-1 | http://www.w3.org/2000/09/xmldsig#sha1 |
| 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 restricted to verify-only for interop with legacy IdPs.
Sourcepub fn output_len(self) -> usize
pub fn output_len(self) -> usize
The expected output length in bytes.
Trait Implementations§
Source§impl Clone for DigestAlgorithm
impl Clone for DigestAlgorithm
Source§fn clone(&self) -> DigestAlgorithm
fn clone(&self) -> DigestAlgorithm
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DigestAlgorithm
impl Debug for DigestAlgorithm
Source§impl Hash for DigestAlgorithm
impl Hash for DigestAlgorithm
Source§impl PartialEq for DigestAlgorithm
impl PartialEq for DigestAlgorithm
impl Copy for DigestAlgorithm
impl Eq for DigestAlgorithm
impl StructuralPartialEq for DigestAlgorithm
Auto Trait Implementations§
impl Freeze for DigestAlgorithm
impl RefUnwindSafe for DigestAlgorithm
impl Send for DigestAlgorithm
impl Sync for DigestAlgorithm
impl Unpin for DigestAlgorithm
impl UnsafeUnpin for DigestAlgorithm
impl UnwindSafe for DigestAlgorithm
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more