Skip to main content

Context

Struct Context 

Source
pub struct Context<'scope, 'model, 'document> { /* private fields */ }
Expand description

Short original token view. Any references into its movable parsed model are restricted to this callback, independently of original document lifetimes.

Implementations§

Source§

impl<'m, 'd> Context<'_, 'm, 'd>

Source

pub fn check_archive_carried<'a, 'p, P, PE, RE>( &'a self, provider: &'a P, path: &'p CheckedPath<'d>, certificate_parent: &Reader<'d>, time: &CheckTime<'_, 'd>, recognizes: impl FnMut(&TokenExtension<'_>, &Execution<'_>) -> Result<bool, RE>, ) -> Result<ArchiveChecked<'m, 'd, 'p>, ArchiveCheckError<InputError<Infallible>, PE, RE>>
where P: for<'scope> SignatureProvider<'scope, Error = PE>,

Checks ATSv3 against ORIGINAL attached eContent. The imprint input contains its content digest, never a copied/normalized whole document. This delegates index matching and range construction to the existing CMS archive kernel (EN319122-1 §§5.5.2–5.5.3).

Source

pub fn check_archive_detached<'a, 'p, P, S: Source, PE, RE>( &'a self, provider: &'a P, path: &'p CheckedPath<'d>, certificate_parent: &Reader<'d>, time: &CheckTime<'_, 'd>, detached: &mut S, recognizes: impl FnMut(&TokenExtension<'_>, &Execution<'_>) -> Result<bool, RE>, ) -> Result<ArchiveChecked<'m, 'd, 'p>, ArchiveCheckError<InputError<S::Error>, PE, RE>>
where P: for<'scope> SignatureProvider<'scope, Error = PE>,

Checks the explicit detached input only when original eContent is absent. The common source driver preserves incomplete/refused EOF; detached acquisition is never a substitute for a carried document.

Source§

impl<'m, 'd> Context<'_, 'm, 'd>

Source

pub fn check_historical<'a, 'p, P, S: Source, PE, RE>( &'a self, provider: &'a P, path: &'p CheckedPath<'d>, certificate_parent: &Reader<'d>, time: &CheckTime<'_, 'd>, input: &mut HistoricalInput<'_, 'm, 'd, S>, recognizes: impl FnMut(&TokenExtension<'_>, &Execution<'_>) -> Result<bool, RE>, ) -> Result<HistoricalChecked<'m, 'd, 'p>, CheckError<StreamError<S::Error>, PE, RE>>
where P: for<'scope> SignatureProvider<'scope, Error = PE>,

Performs the SAME complete common CMS/ESS/TSA/effective-key/path/time pipeline as an ordinary token, using this sealed historical recipe. Historical mathematical validity does not waive modern baseline rules.

Source§

impl<'m, 'd> Context<'_, 'm, 'd>

Source

pub fn check_references<'a, 'p, P, PE, RE>( &'a self, provider: &'a P, path: &'p CheckedPath<'d>, certificate_parent: &Reader<'d>, time: &CheckTime<'_, 'd>, input: &mut ReferenceInput<'_, 'm, 'd>, recognizes: impl FnMut(&TokenExtension<'_>, &Execution<'_>) -> Result<bool, RE>, ) -> Result<ReferenceChecked<'m, 'd, 'p>, CheckError<Infallible, PE, RE>>
where P: for<'scope> SignatureProvider<'scope, Error = PE>,

Runs the existing complete TSA pipeline with the sealed .25/.26 input. This is ValidationData purpose, never Archive or Signature purpose; successful legacy math cannot waive modern baseline conformance.

Source§

impl<'m, 'd> Context<'_, 'm, 'd>

Source

pub fn properties(&self) -> Option<&Properties<'d>>

First-read original legacy validation models and unchanged diagnostics. This does not reparse the timestamp or a material field.

Source

pub fn token(&self) -> &Token<'d>

Original envelope for pool selection/inspection without another parse.

Source

pub fn reader(&self) -> &Reader<'d>

Current original envelope reader for original CMS queries.

Source

pub fn check_content<'a, 'p, P, PE, RE>( &'a self, provider: &'a P, path: &'p CheckedPath<'d>, certificate_parent: &Reader<'d>, time: &CheckTime<'_, 'd>, recognizes: impl FnMut(&TokenExtension<'_>, &Execution<'_>) -> Result<bool, RE>, ) -> Result<Checked<'m, 'd, 'p>, CheckError<InputError<Infallible>, PE, RE>>
where P: for<'scope> SignatureProvider<'scope, Error = PE>,

Checks a content timestamp against the actual original carried input. At a counter this is the parent’s signature octets; at the root this is eContent. An absent root eContent requires the separate explicit detached operation, and never silently selects the signature or empty bytes.

Source

pub fn check_detached_content<'a, 'p, P, S: Source, PE, RE>( &'a self, provider: &'a P, path: &'p CheckedPath<'d>, certificate_parent: &Reader<'d>, time: &CheckTime<'_, 'd>, detached: &mut S, recognizes: impl FnMut(&TokenExtension<'_>, &Execution<'_>) -> Result<bool, RE>, ) -> Result<Checked<'m, 'd, 'p>, CheckError<InputError<S::Error>, PE, RE>>
where P: for<'scope> SignatureProvider<'scope, Error = PE>,

Checks an explicit detached root content input. A counter, signature timestamp or original carried payload refuses before source/provider use.

Source

pub fn check_signature<'a, 'p, P, PE, RE>( &'a self, provider: &'a P, path: &'p CheckedPath<'d>, certificate_parent: &Reader<'d>, time: &CheckTime<'_, 'd>, recognizes: impl FnMut(&TokenExtension<'_>, &Execution<'_>) -> Result<bool, RE>, ) -> Result<Checked<'m, 'd, 'p>, CheckError<InputError<Infallible>, PE, RE>>
where P: for<'scope> SignatureProvider<'scope, Error = PE>,

Check a root OR nested counter’s signature timestamp over that actual owner’s signature CONTENT octets. Whole SignerInfo encodings, parent signatures and caller replacement bytes cannot enter this operation. EN319122-1 §5.3 and RFC5652 §11.4 define these different coverages. https://www.rfc-editor.org/rfc/rfc5652#section-11.4

Auto Trait Implementations§

§

impl<'scope, 'model, 'document> !RefUnwindSafe for Context<'scope, 'model, 'document>

§

impl<'scope, 'model, 'document> !Send for Context<'scope, 'model, 'document>

§

impl<'scope, 'model, 'document> !Sync for Context<'scope, 'model, 'document>

§

impl<'scope, 'model, 'document> !UnwindSafe for Context<'scope, 'model, 'document>

§

impl<'scope, 'model, 'document> Freeze for Context<'scope, 'model, 'document>

§

impl<'scope, 'model, 'document> Unpin for Context<'scope, 'model, 'document>

§

impl<'scope, 'model, 'document> UnsafeUnpin for Context<'scope, 'model, 'document>

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.