pub struct TokenInfo<'a> { /* private fields */ }Expand description
Required timestamp facts and optional values, independently of acceptance. Original bytes are borrowed; diagnostics/catalogues own their accounted capacity.
Implementations§
Source§impl<'a> TokenInfo<'a>
impl<'a> TokenInfo<'a>
Sourcepub fn read(parent: &Reader<'a>, element: &Element<'a>) -> Result<Self>
pub fn read(parent: &Reader<'a>, element: &Element<'a>) -> Result<Self>
Reads RFC3161 §2.4.2 fields under the original producing reader.
A BER inspection reader retains DER/schema faults instead of repairing source bytes. This is not token acceptance: every nested fault remains visible and must be considered before successful proof extraction. INTEGER roles follow required/optional schema order; competing serial/ nonce assignments refuse. Unknown bounded fields remain diagnostics. https://www.rfc-editor.org/rfc/rfc3161#section-2.4.2
Sourcepub fn policy(&self) -> Oid<'a>
pub fn policy(&self) -> Oid<'a>
Original policy OID; acceptable policy selection belongs to the caller.
Sourcepub fn imprint(&self) -> &MessageImprint<'a>
pub fn imprint(&self) -> &MessageImprint<'a>
Original imprint fields, including explicit malformed algorithm syntax.
Sourcepub fn serial(&self) -> IntegerField<'a>
pub fn serial(&self) -> IntegerField<'a>
Original serial; RFC3161 imposes no positivity or 160-bit maximum.
Sourcepub fn gen_time(&self) -> Reading
pub fn gen_time(&self) -> Reading
Shared UTC label/precision reading; supplied UTC facts remain independent.
Sourcepub fn accuracy(&self) -> Option<&AccuracyReading<'a>>
pub fn accuracy(&self) -> Option<&AccuracyReading<'a>>
Absent complete Accuracy differs from a present empty/invalid reading.
Sourcepub fn ordering(&self) -> bool
pub fn ordering(&self) -> bool
Original ordering BOOLEAN, with FALSE only for its normative absent default.
Sourcepub fn nonce(&self) -> Option<IntegerField<'a>>
pub fn nonce(&self) -> Option<IntegerField<'a>>
Original optional nonce, without a fixed width or sign policy.
Sourcepub fn tsa(&self) -> Option<&TsaReading<'a>>
pub fn tsa(&self) -> Option<&TsaReading<'a>>
Original explicit wrapper and common GeneralName reading or malformation.
Sourcepub fn extensions(&self) -> Option<&TokenExtensions<'a>>
pub fn extensions(&self) -> Option<&TokenExtensions<'a>>
Original optional extension catalogue and its own recovery diagnostics.
Sourcepub fn faults(&self) -> &[Error]
pub fn faults(&self) -> &[Error]
Root schema/DER faults; nested imprint/accuracy/extension faults stay there.
Sourcepub fn has_faults(&self) -> bool
pub fn has_faults(&self) -> bool
Any retained root or nested conformance fault, without scanning collections.
Source§impl TokenInfo<'_>
impl TokenInfo<'_>
Sourcepub fn matches_request_fields(
&self,
requested: &Request<'_>,
token_parent: &Reader<'_>,
requested_parent: &Reader<'_>,
) -> Result<RequestFields, RequestFieldError>
pub fn matches_request_fields( &self, requested: &Request<'_>, token_parent: &Reader<'_>, requested_parent: &Reader<'_>, ) -> Result<RequestFields, RequestFieldError>
Compares requested nonce/policy after preflighting both original sessions.
RFC3161 §2.4.2 requires the same nonce when one was requested. The common INTEGER decoder supplies minimal numeric views without re-encoding the original input. Every byte comparison is admitted by current token work. These facts do not imply complete imprint equality, freshness or trust. https://www.rfc-editor.org/rfc/rfc3161.html#section-2.4.2
Source§impl TokenInfo<'_>
impl TokenInfo<'_>
Checks two original sources without rebuilding or selecting a trust path.
RFC3161 §§2.3/2.4.2 require exclusive critical EKU and correspondence to a certificate subject name. The supplied certificate must separately be selected, signature-verified and trusted by the caller’s common CMS/PKIX checks. Lookup/comparison use token query work; lazy certificate values retain their own producing session/depth and its current execution. https://www.rfc-editor.org/rfc/rfc3161.html#section-2.3
Source§impl TokenInfo<'_>
impl TokenInfo<'_>
Sourcepub fn retain_facts(&self, parent: &Reader<'_>) -> Result<RetainedFacts>
pub fn retain_facts(&self, parent: &Reader<'_>) -> Result<RetainedFacts>
Retains this generation/imprint projection before the scoped source ends.
A retained malformed token is not silently turned into conforming data. This projection refuses inspection faults; the original model and all diagnostics remain available on refusal. It copies only declared facts, not a certificate, source payload, provider state or a trust assertion.