Skip to main content

TokenInfo

Struct TokenInfo 

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

Source

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

Source

pub fn policy(&self) -> Oid<'a>

Original policy OID; acceptable policy selection belongs to the caller.

Source

pub fn imprint(&self) -> &MessageImprint<'a>

Original imprint fields, including explicit malformed algorithm syntax.

Source

pub fn serial(&self) -> IntegerField<'a>

Original serial; RFC3161 imposes no positivity or 160-bit maximum.

Source

pub fn gen_time(&self) -> Reading

Shared UTC label/precision reading; supplied UTC facts remain independent.

Source

pub fn accuracy(&self) -> Option<&AccuracyReading<'a>>

Absent complete Accuracy differs from a present empty/invalid reading.

Source

pub fn ordering(&self) -> bool

Original ordering BOOLEAN, with FALSE only for its normative absent default.

Source

pub fn nonce(&self) -> Option<IntegerField<'a>>

Original optional nonce, without a fixed width or sign policy.

Source

pub fn tsa(&self) -> Option<&TsaReading<'a>>

Original explicit wrapper and common GeneralName reading or malformation.

Source

pub fn extensions(&self) -> Option<&TokenExtensions<'a>>

Original optional extension catalogue and its own recovery diagnostics.

Source

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

Root schema/DER faults; nested imprint/accuracy/extension faults stay there.

Source

pub fn has_faults(&self) -> bool

Any retained root or nested conformance fault, without scanning collections.

Source

pub fn span(&self) -> Span

Whole original TSTInfo range, never reconstructed from scalar fields.

Source§

impl TokenInfo<'_>

Source

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<'_>

Source

pub fn authority( &self, certificate: &Certificate<'_>, token_parent: &Reader<'_>, certificate_parent: &Reader<'_>, ) -> Result<AuthorityFacts, AuthorityError>

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<'_>

Source

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.

Trait Implementations§

Source§

impl<'a> Debug for TokenInfo<'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 TokenInfo<'a>

§

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

§

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

§

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

§

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

§

impl<'a> Unpin for TokenInfo<'a>

§

impl<'a> UnsafeUnpin for TokenInfo<'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.