Skip to main content

MessageImprint

Struct MessageImprint 

Source
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>

Source

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

Source

pub fn algorithm(&self) -> &HashAlgorithmReading<'a>

Original written algorithm or explicit unreadable/malformed alternative.

Source

pub fn hashed(&self) -> &Octets<'a>

Original logical hash bytes, including original BER fragment spans.

Source

pub fn span(&self) -> Span

Original complete MessageImprint range.

Source

pub fn faults(&self) -> &[Error]

Readable faults, which cannot be silently ignored for proof acceptance.

Source§

impl<'a> MessageImprint<'a>

Source

pub fn check_content<P: DigestProvider<'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>

Source

pub fn check_requested_content<P: DigestProvider<'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.

Source

pub fn matches_request<P: DigestProvider<'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

Trait Implementations§

Source§

impl<'a> Debug for MessageImprint<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for MessageImprint<'a>

§

impl<'a> !RefUnwindSafe for MessageImprint<'a>

§

impl<'a> !Send for MessageImprint<'a>

§

impl<'a> !Sync for MessageImprint<'a>

§

impl<'a> !UnwindSafe for MessageImprint<'a>

§

impl<'a> Unpin for MessageImprint<'a>

§

impl<'a> UnsafeUnpin for MessageImprint<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.