Skip to main content

Index

Struct Index 

Source
pub struct Index<'source, N, D, G, P, O, W: Work, I> { /* private fields */ }
Expand description

Accounted scoped index of every original occurrence. Keys borrow original DER, not copied/normalized certificate names or unqualified fingerprints. The same artifact in several containers keeps ALL locations, so later archive/actor checks cannot mistake a late or disallowed copy for coverage.

P is the format’s placement of an occurrence and O an entry of the format’s schema-open catalogue; the index stores and returns both unread. Only the holder of issuer I builds it from the format’s own pools, and it locates material only under coverage and evidence of the same issuer.

Implementations§

Source§

impl<'source, N: Copy + Eq, D: Copy + Eq, G: Copy + Eq, P: Copy, O, W: Work, I> Index<'source, N, D, G, P, O, W, I>

Source

pub fn new<Q: Query<Id = N, Document = D, Generation = G, Work = W>>( _issuer: I, signature: N, open: &'source [O], query: &Q, ) -> Result<Self, IndexError<N>>

An empty index for this signature in the query’s source generation.

open is the format’s schema-open material catalogue, retained only so that format checks find it beside the index. Requiring the issuer value keeps a caller of the format from building an index of its own.

Source

pub fn insert<Q: Query<Id = N, Document = D, Generation = G, Work = W>>( &mut self, _issuer: I, artifact: ArtifactRef<'_, 'source>, occurrence: Occurrence<N, D, G, P>, query: &Q, ) -> Result<(), IndexError<N>>

Records one occurrence of an exact original artifact. For an OCSP value every certificate embedded in its basic response is recorded too, with the same location and placement. Hashing, probes and storage are admitted first; a refusal leaves the index for the caller to drop. The builder pays its own traversal of the format’s pools with Self::admit. Requiring the issuer value keeps a caller of the format, which may own the index, from adding material the document does not carry.

Source

pub fn open(&self) -> &'source [O]

The format’s schema-open catalogue, as supplied.

Source

pub fn signature(&self) -> N

Original selected signature of this index.

Source

pub fn snapshot(&self) -> Snapshot<D, G>

Source generation of every occurrence.

Source

pub fn certificate<'view, 'query, Q: Query<Id = N, Document = D, Generation = G>>( &'view self, value: &Certificate<'_>, query: &'query Q, ) -> Result<Occurrences<'view, 'query, 'source, N, D, G, P, O, W, Q, I>, IndexError<N>>

Finds all copies of this exact original certificate, including copies inside OCSP. A match is availability only, never authentication/trust.

Source

pub fn crl<'view, 'query, Q: Query<Id = N, Document = D, Generation = G>>( &'view self, value: &CertificateList<'_>, query: &'query Q, ) -> Result<Occurrences<'view, 'query, 'source, N, D, G, P, O, W, Q, I>, IndexError<N>>

Finds all whole CRL copies. An authenticated delta still needs its authenticated/bound complete source; finding either alone proves no pair.

Source

pub fn ocsp<'view, 'query, Q: Query<Id = N, Document = D, Generation = G>>( &'view self, value: &BasicResponse<'_>, query: &'query Q, ) -> Result<Occurrences<'view, 'query, 'source, N, D, G, P, O, W, Q, I>, IndexError<N>>

Finds the exact basic response in format-issued retained occurrences. Good-looking status or a successful wire code does not mint evidence.

Source

pub fn artifact<'view, 'query, Q: Query<Id = N, Document = D, Generation = G>>( &'view self, artifact: ArtifactRef<'_, '_>, query: &'query Q, ) -> Result<Occurrences<'view, 'query, 'source, N, D, G, P, O, W, Q, I>, IndexError<N>>

Finds all copies of this exact artifact, in source catalogue order.

Source

pub fn require_signature<Q: Query<Id = N, Document = D, Generation = G>>( &self, signature: N, query: &Q, ) -> Result<(), IndexError<N>>

Requires that this index was built for signature.

Source

pub fn archived<Q: Query<Id = N, Document = D, Generation = G>, C: Work>( &self, artifact: ArtifactRef<'_, '_>, coverage: &Coverage<N, D, G, C, I>, evidence: &Verified<N, D, G, I>, query: &Q, ) -> Result<Archived<N, D, G, P>, ArchiveError<N>>
where N: HashWork,

Locates a whole original artifact in this exact checked archive input.

EN319132-1 §6.3(aa)/§5.5.2.2 requires the necessary material to have been incorporated before generating each archive timestamp. This uses the same selection the format used for actual timestamp input, so merely finding a late or self-carried copy cannot count as covered. All copies remain available; an early uncovered duplicate does not hide a covered one. This proves mathematical availability only. The caller must derive required artifacts from actual actor/path/status checks and must authenticate the TSA separately before claiming a baseline level. https://www.etsi.org/deliver/etsi_en/319100_319199/31913201/01.03.01_60/en_31913201v010301p.pdf

Source

pub fn archived_path<'path, 'document, Q, C: Work>( &self, path: &'path CheckedPath<'document>, coverage: &Coverage<N, D, G, C, I>, evidence: &Verified<N, D, G, I>, query: &Q, ) -> Result<PathCertificates<'path, 'document, N, D, G, P>, ArchiveError<N>>
where N: HashWork, Q: Query<Id = N, Document = D, Generation = G>,

Derives certificate requirements from the actual common-validator path, including an existing anchor certificate, then checks each exact artifact against this archive’s mathematical input. Missing/late copies remain facts; resource/source failure returns no successful partial census.

EN319132-1 V1.3.1 §§5.4.2/5.5.2.2/6.3(aa) require the material of the actual actors before each archive. This certificate component does not assert that status, credential, countersigner or previous-TSA processing completed. The caller must supply their separately bound paths. https://www.etsi.org/deliver/etsi_en/319100_319199/31913201/01.03.01_60/en_31913201v010301p.pdf

Source

pub fn admit<Q: Query<Id = N, Document = D, Generation = G>>( &self, query: &Q, ) -> Result<(), IndexError<N>>

Admits one traversal step over this index’s source generation.

Auto Trait Implementations§

§

impl<'source, N, D, G, P, O, W, I> !Freeze for Index<'source, N, D, G, P, O, W, I>

§

impl<'source, N, D, G, P, O, W, I> RefUnwindSafe for Index<'source, N, D, G, P, O, W, I>

§

impl<'source, N, D, G, P, O, W, I> Send for Index<'source, N, D, G, P, O, W, I>
where Snapshot<D, G>: Send, N: Send, OwnedMap<ArtifactKey<'source>, (usize, usize), W>: Send, OwnedVec<Entry<N, D, G, P>, W>: Send, &'source [O]: Send, PhantomData<I>: Send,

§

impl<'source, N, D, G, P, O, W, I> Sync for Index<'source, N, D, G, P, O, W, I>
where Snapshot<D, G>: Sync, N: Sync, OwnedMap<ArtifactKey<'source>, (usize, usize), W>: Sync, OwnedVec<Entry<N, D, G, P>, W>: Sync, &'source [O]: Sync, PhantomData<I>: Sync,

§

impl<'source, N, D, G, P, O, W, I> Unpin for Index<'source, N, D, G, P, O, W, I>
where Snapshot<D, G>: Unpin, N: Unpin, OwnedMap<ArtifactKey<'source>, (usize, usize), W>: Unpin, OwnedVec<Entry<N, D, G, P>, W>: Unpin, &'source [O]: Unpin, PhantomData<I>: Unpin,

§

impl<'source, N, D, G, P, O, W, I> UnsafeUnpin for Index<'source, N, D, G, P, O, W, I>
where Snapshot<D, G>: UnsafeUnpin, N: UnsafeUnpin, OwnedMap<ArtifactKey<'source>, (usize, usize), W>: UnsafeUnpin, OwnedVec<Entry<N, D, G, P>, W>: UnsafeUnpin, &'source [O]: UnsafeUnpin, PhantomData<I>: UnsafeUnpin,

§

impl<'source, N, D, G, P, O, W, I> UnwindSafe for Index<'source, N, D, G, P, O, W, I>
where Snapshot<D, G>: UnwindSafe, N: UnwindSafe, OwnedMap<ArtifactKey<'source>, (usize, usize), W>: UnwindSafe, OwnedVec<Entry<N, D, G, P>, W>: UnwindSafe, &'source [O]: UnwindSafe, PhantomData<I>: UnwindSafe,

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.