#[repr(u8)]pub enum Algorithm {
RsaSha1 = 0,
RsaSha256 = 1,
Ed25519Sha256 = 2,
MlDsa44 = 3,
}Expand description
A signature algorithm, as named in the a= tag of DKIM (RFC 6376
Section 3.5) and ARC signatures and in the s= tag of DKIM2 signatures.
Variants§
RsaSha1 = 0
rsa-sha1 (RFC 6376 Section 3.3.1). This crate only verifies it;
RFC 8301 deprecates it for both signing and verifying.
RsaSha256 = 1
rsa-sha256 (RFC 6376 Section 3.3.2). This is the default.
Ed25519Sha256 = 2
ed25519-sha256 (RFC 8463).
MlDsa44 = 3
mldsa44: “pure” ML-DSA-44 (FIPS 204 ML-DSA.Sign and ML-DSA.Verify,
not HashML-DSA) with the context string DKIM2, signing the DKIM2
signature input (draft-ietf-dkim-dkim2-spec Sections 3.4 and 12.8)
without hashing it first. DKIM2 only.
Implementations§
Source§impl Algorithm
impl Algorithm
Sourcepub fn parse(name: &[u8]) -> Option<Self>
pub fn parse(name: &[u8]) -> Option<Self>
Parses a DKIM or ARC algorithm name (rsa-sha1, rsa-sha256 or
ed25519-sha256), ignoring ASCII case. Returns None for any other
name, including the DKIM2-only mldsa44.
Sourcepub fn parse_dkim2(name: &[u8]) -> Option<Self>
pub fn parse_dkim2(name: &[u8]) -> Option<Self>
Parses a DKIM2 signature algorithm name (rsa-sha256,
ed25519-sha256 or mldsa44). Names are
case-sensitive (draft-ietf-dkim-dkim2-spec Section 2.14), and
rsa-sha1 is not a DKIM2 algorithm.
Trait Implementations§
impl Copy for Algorithm
impl Eq for Algorithm
Source§impl From<Algorithm> for HashAlgorithm
impl From<Algorithm> for HashAlgorithm
Source§impl From<Algorithm> for AlgorithmName
impl From<Algorithm> for AlgorithmName
impl StructuralPartialEq for Algorithm
Auto Trait Implementations§
impl Freeze for Algorithm
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnsafeUnpin for Algorithm
impl UnwindSafe for Algorithm
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more