pub struct DkimHeader {Show 14 fields
pub version: u32,
pub algorithm: Algorithm,
pub signature_b64: String,
pub body_hash_b64: String,
pub canon_header: Canon,
pub canon_body: Canon,
pub domain: String,
pub selector: String,
pub signed_headers: Vec<String>,
pub body_length: Option<u64>,
pub timestamp: Option<u64>,
pub expiration: Option<u64>,
pub identity: Option<String>,
pub query_method: String,
}Expand description
Parsed DKIM-Signature header. Borrows the b= (signature) and
bh= (body hash) base64 strings + the signed-header list etc.
Owned String is used for tag values that we may need to
case-fold or massage during verify (e.g. signed-header names get
lowercased for relaxed canon).
Fields§
§version: u32v= — version (must be “1” per RFC 6376).
algorithm: Algorithma= — signature algorithm.
signature_b64: Stringb= — base64-encoded signature bytes.
body_hash_b64: Stringbh= — base64-encoded body hash.
canon_header: Canonc= — (header_canon, body_canon) tuple. Default
(Simple, Simple) per spec.
canon_body: Canonsee Self::canon_header.
domain: Stringd= — signing domain (used in the selector DNS lookup).
selector: Strings= — selector (used in <s>._domainkey.<d> TXT lookup).
signed_headers: Vec<String>h= — colon-separated list of signed header names, in the
order they were signed. Lowercased and trimmed in
parse so verifier doesn’t have to.
body_length: Option<u64>l= — optional body length limit. Some signers sign only the
first N bytes of the body to allow trailing additions.
timestamp: Option<u64>t= — optional signature timestamp (seconds since epoch).
expiration: Option<u64>x= — optional expiry (seconds since epoch). Verifier checks
now > x → expired.
identity: Option<String>i= — optional identity (used for DMARC alignment but not
for hash inputs).
query_method: Stringq= — query method (default “dns/txt”). We only support
“dns/txt”; anything else → UnsupportedAlgorithm.
Implementations§
Source§impl DkimHeader
impl DkimHeader
Sourcepub fn parse(value: &str) -> Result<Self, DkimError>
pub fn parse(value: &str) -> Result<Self, DkimError>
Parse a single DKIM-Signature: header value. Caller has already
stripped the DKIM-Signature: prefix; this function expects the
VALUE portion (everything after the first :).
The header may contain folded continuation lines (CRLF + WSP); we unfold internally before parsing tags.
Trait Implementations§
Source§impl Clone for DkimHeader
impl Clone for DkimHeader
Source§fn clone(&self) -> DkimHeader
fn clone(&self) -> DkimHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DkimHeader
impl RefUnwindSafe for DkimHeader
impl Send for DkimHeader
impl Sync for DkimHeader
impl Unpin for DkimHeader
impl UnsafeUnpin for DkimHeader
impl UnwindSafe for DkimHeader
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<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