pub struct MessageImprint<'a> { /* private fields */ }Expand description
Borrowed algorithm/hash fields and independently accounted diagnostics. Reading is independent of algorithm support, output width and token trust.
Implementations§
Source§impl<'a> MessageImprint<'a>
impl<'a> MessageImprint<'a>
Sourcepub fn read(parent: &Reader<'a>, element: &Element<'a>) -> Result<Self>
pub fn read(parent: &Reader<'a>, element: &Element<'a>) -> Result<Self>
Reads the two original fields of RFC3161 §2.4.1 MessageImprint.
The normative algorithm is AlgorithmIdentifier. Inspection retains a
uniquely bounded malformed first field and readable OCTET STRING, with
faults; a bare OID does not become a fabricated valid identifier. This
recovery is not specified by RFC3161. Missing/unreadable hash refuses.
The selected provider resolves written identifiers and their full
parameter/output semantics separately; no fixed hash registry is assumed.
https://www.rfc-editor.org/rfc/rfc3161#section-2.4.1
Sourcepub fn algorithm(&self) -> &HashAlgorithmReading<'a>
pub fn algorithm(&self) -> &HashAlgorithmReading<'a>
Original written algorithm or explicit unreadable/malformed alternative.
Source§impl<'a> MessageImprint<'a>
impl<'a> MessageImprint<'a>
Sourcepub fn check_content<P: AsnDigest<'a>, S: Source>(
&self,
provider: &'a P,
parent: &Reader<'a>,
source: &mut S,
) -> Result<ImprintAgreement, ImprintError<S::Error, P::Error>>
pub fn check_content<P: AsnDigest<'a>, S: Source>( &self, provider: &'a P, parent: &Reader<'a>, source: &mut S, ) -> Result<ImprintAgreement, ImprintError<S::Error, P::Error>>
Computes the declared imprint over exactly one complete source pass.
RFC3161 §2.4.1 identifies the hash by its complete written algorithm, not
by output length. Resolution, malformed syntax and known impossible width
precede state creation and source I/O. Finalized output is matched under
the same selected provider, without replay, re-resolution or rehashing.
Source/provider/resource failures cannot become Differs. Success is an
imprint fact only; signature, ESS, path, request and time acceptance remain
separate checks. https://www.rfc-editor.org/rfc/rfc3161#section-2.4.1
Source§impl<'a> MessageImprint<'a>
impl<'a> MessageImprint<'a>
Sourcepub fn check_requested_content<P: AsnDigest<'a>, S: Source>(
&self,
requested: &MessageImprint<'a>,
provider: &'a P,
parents: (&Reader<'a>, &Reader<'a>),
covered: &mut S,
) -> Result<(ImprintAgreement, RequestAgreement), RequestedContentError<S::Error, P::Error>>
pub fn check_requested_content<P: AsnDigest<'a>, S: Source>( &self, requested: &MessageImprint<'a>, provider: &'a P, parents: (&Reader<'a>, &Reader<'a>), covered: &mut S, ) -> Result<(ImprintAgreement, RequestAgreement), RequestedContentError<S::Error, P::Error>>
Compares the full request and hashes covered bytes using one token identity. Request bytes themselves are never hashed. Semantic request disagreement remains independent of covered-content agreement; an unusable token declaration starts no digest state or content pass. No identity Clone, second token parameter resolve, state reconstruction or rehash is used.
Sourcepub fn matches_request<P: AsnDigest<'a>>(
&self,
requested: &MessageImprint<'a>,
provider: &'a P,
token_parent: &Reader<'a>,
requested_parent: &Reader<'a>,
) -> Result<RequestAgreement, RequestImprintError<P::Error>>
pub fn matches_request<P: AsnDigest<'a>>( &self, requested: &MessageImprint<'a>, provider: &'a P, token_parent: &Reader<'a>, requested_parent: &Reader<'a>, ) -> Result<RequestAgreement, RequestImprintError<P::Error>>
Compares the entire parsed requested imprint under one selected provider.
RFC3161 §§2.2/2.4.2 requires the requested hash and algorithm. Both operands
use the same semantic resolution/known-width kernel as content checking.
Each reader must be from its own operand’s session; legitimate different
sessions are allowed. Comparison uses the token’s current execution;
resolution uses each operand’s original local/current aggregate ceilings.
Core creates no hash state or content pass, fabricates no identifier and
performs no parameter serialization or replacement-parser decoding. The
provider reads original parameters under each producing reader’s budget.
Malformed equal-width declarations cannot produce successful equality.
A joined token location uses its token source map; a requested location
uses its own original provenance. Nonce, policy, certReq and timeliness
remain separate checks. https://www.rfc-editor.org/rfc/rfc3161#section-2.2