Skip to main content

CrlCache

Struct CrlCache 

Source
pub struct CrlCache { /* private fields */ }
Expand description

Process-wide CRL cache.

Implementations§

Source§

impl CrlCache

Source

pub fn new(fetcher: Arc<dyn CrlFetcher>) -> Arc<Self>

Source

pub fn ensure_loaded( &self, sources: &[(CrlSourceId, CrlFetchFailure)], ) -> Result<(), String>

Synchronous link-time loader. Each source is fetched with a 30-second timeout. On success, parses nextUpdate and stores the bytes. On failure, behavior depends on policy:

§Panics

Must be called from within a multi-thread tokio runtime — uses block_in_place + Handle::current().block_on. Single-thread runtimes panic.

§Errors

String description of the first reject-policy source that failed to load. Tolerate-policy failures are kept silent at link time (logged as transitions, but Ok returned).

Source

pub fn snapshot( &self, sources: &[CrlSourceId], ) -> Result<Vec<Arc<CertificateRevocationListDer<'static>>>, String>

Read-only handshake-time accessor. Returns the latest CRL bytes for each requested source. Sources whose policy is tolerate and whose entry has never successfully loaded are silently dropped from the result. Sources whose policy is reject and whose entry is currently unavailable cause this function to return Err — wrappers turn that into a handshake failure.

§Errors

Returns the first reject-policy source whose state is Unavailable.

Source

pub fn ensure_loaded_new( &self, sources: &[(CrlSourceId, CrlFetchFailure)], ) -> Result<(), String>

Reload-friendly variant of Self::ensure_loaded: only fetches sources whose entry is not already registered. Useful from the reload path so an unchanged URL source doesn’t re-block on a cold fetch every time the watcher fires.

File sources are always re-fetched (their bytes are local).

§Panics

Same multi-thread runtime requirement as Self::ensure_loaded.

§Errors

As Self::ensure_loaded.

Source

pub fn spawn_refresher(self: &Arc<Self>, shutdown: &CancellationToken)

Spawn the background refresh loop. One tokio task per URL source — file sources don’t refresh here (callers re-read them via Self::ensure_loaded on reload). Cancellation token lets the host stop the workers at shutdown.

Trait Implementations§

Source§

impl Debug for CrlCache

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more