pub struct RevocationChecker { /* private fields */ }Expand description
Synchronous revocation checker with caching.
Checks bundle revocation status via online endpoints and CRL lists. Results are cached for the configured TTL to avoid redundant network requests.
The default transport uses rustls, validates and pins DNS results, disables redirects and proxies, and bounds every accepted response. A custom transport can be injected for deterministic tests.
Implementations§
Source§impl RevocationChecker
impl RevocationChecker
Sourcepub fn new(cache_ttl: Duration, timeout: Duration) -> Self
pub fn new(cache_ttl: Duration, timeout: Duration) -> Self
Create a new revocation checker.
§Arguments
cache_ttl- How long cached results remain valid.timeout- Maximum time to wait for an HTTP response.
Sourcepub fn with_limits(
cache_ttl: Duration,
timeout: Duration,
max_cache_entries: usize,
max_crl_cache_entries: usize,
) -> Self
pub fn with_limits( cache_ttl: Duration, timeout: Duration, max_cache_entries: usize, max_crl_cache_entries: usize, ) -> Self
Create a checker with explicit bounded cache capacities.
§Panics
Panics when either cache limit is zero.
Sourcepub fn with_transport<T>(
cache_ttl: Duration,
timeout: Duration,
transport: T,
) -> Selfwhere
T: RevocationTransport + 'static,
pub fn with_transport<T>(
cache_ttl: Duration,
timeout: Duration,
transport: T,
) -> Selfwhere
T: RevocationTransport + 'static,
Create a checker with an injected transport.
Sourcepub fn check(
&mut self,
jti: &str,
check_uri: Option<&str>,
crl_uri: Option<&str>,
) -> RevocationStatus
pub fn check( &mut self, jti: &str, check_uri: Option<&str>, crl_uri: Option<&str>, ) -> RevocationStatus
Check the revocation status of a bundle by JTI.
Checks in order:
- Cache (if a cached result exists and has not expired).
- Online endpoint (if
check_uriis provided). - CRL (if
crl_uriis provided).
If a configured check cannot establish status, returns a fail-closed unavailable status. A manifest with no revocation configuration remains not revoked.
Sourcepub fn check_with_issuer(
&mut self,
jti: &str,
check_uri: Option<&str>,
crl_uri: Option<&str>,
expected_issuer: Option<&str>,
) -> RevocationStatus
pub fn check_with_issuer( &mut self, jti: &str, check_uri: Option<&str>, crl_uri: Option<&str>, expected_issuer: Option<&str>, ) -> RevocationStatus
Check revocation while binding CRLs and cached decisions to an issuer.
Sourcepub fn insert_crl(&mut self, uri: &str, crl: Crl)
pub fn insert_crl(&mut self, uri: &str, crl: Crl)
Manually insert a CRL into the cache (useful for testing and offline operation).
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear all caches.