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>
impl<'m, 'd> Context<'_, 'm, 'd>
Sourcepub 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>,
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).
Sourcepub 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>,
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>
impl<'m, 'd> Context<'_, 'm, 'd>
Sourcepub 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>,
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>
impl<'m, 'd> Context<'_, 'm, 'd>
Sourcepub 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>,
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>
impl<'m, 'd> Context<'_, 'm, 'd>
Sourcepub fn properties(&self) -> Option<&Properties<'d>>
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.
Sourcepub fn token(&self) -> &Token<'d>
pub fn token(&self) -> &Token<'d>
Original envelope for pool selection/inspection without another parse.
Sourcepub 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>,
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.
Sourcepub 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>,
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.
Sourcepub 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>,
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