pub struct Revocation {
pub issuer: String,
pub serial: String,
pub revoked_at: i64,
pub reason: Option<u32>,
pub not_after: Option<i64>,
}Expand description
One revoked certificate.
Fields§
§issuer: StringThe CA that issued it: hex SHA-256 of that CA’s SubjectPublicKeyInfo.
serial: StringThe certificate’s serial, hex, as orders.cert_serial stores it.
revoked_at: i64Epoch seconds.
reason: Option<u32>RFC 5280 §5.3.1 CRLReason code.
not_after: Option<i64>The certificate’s own notAfter, epoch seconds. None is never pruned.
Implementations§
Source§impl Revocation
impl Revocation
Sourcepub async fn insert_if_absent<'e>(
&self,
executor: impl Into<Exec<'e>>,
) -> Result<bool, Error>
pub async fn insert_if_absent<'e>( &self, executor: impl Into<Exec<'e>>, ) -> Result<bool, Error>
Records the revocation unless this serial is already revoked under this issuer, answering whether a row was written.
The first revocation wins: a repeat changes neither its time nor its reason, the rule the file-backed ledger’s merge kept too.
Sourcepub async fn list_for_issuer<'e>(
issuer: &str,
executor: impl Into<Exec<'e>>,
) -> Result<Vec<Self>, Error>
pub async fn list_for_issuer<'e>( issuer: &str, executor: impl Into<Exec<'e>>, ) -> Result<Vec<Self>, Error>
Every revocation recorded under issuer, oldest first.
Sourcepub async fn count_expired(
issuer: &str,
cutoff: i64,
listed_before: i64,
database: &Database,
) -> Result<u64, Error>
pub async fn count_expired( issuer: &str, cutoff: i64, listed_before: i64, database: &Database, ) -> Result<u64, Error>
How many revocations under issuer Self::prune_expired would delete
for the same pair of bounds.
Sourcepub async fn prune_expired<'e>(
issuer: &str,
cutoff: i64,
listed_before: i64,
executor: impl Into<Exec<'e>>,
) -> Result<u64, Error>
pub async fn prune_expired<'e>( issuer: &str, cutoff: i64, listed_before: i64, executor: impl Into<Exec<'e>>, ) -> Result<u64, Error>
Deletes the revocations under issuer whose certificates expired before
cutoff, and which a CRL issued at or after listed_before already
carried (RFC 5280 §3.3), returning how many went.
A row with no not_after is never deleted: an unknown expiry is not
an expired one. The caller backdates cutoff by the clock-skew
allowance.
listed_before is the stored CRL’s thisUpdate, and the second bound
is what §3.3 actually asks for: an entry “MUST NOT be removed from the
CRL until it appears on one regularly scheduled CRL issued beyond the
revoked certificate’s validity period”. A certificate that expired an
hour ago has not yet appeared on any such CRL, so dropping it here would
leave a relying party holding the last CRL that listed it — signed
before the expiry — with nothing to replace it.
The revoked_at bound is inclusive: the CRL is signed from the rows as
they stand when it is built, so an entry stamped in the same second is
one it carries. An entry recorded in that second but after the snapshot
could be dropped without having been listed, and only if it is also
already expired — a revocation of a certificate nothing would honour
anyway.
Trait Implementations§
Source§impl Clone for Revocation
impl Clone for Revocation
Source§impl Debug for Revocation
impl Debug for Revocation
impl Eq for Revocation
Source§impl PartialEq for Revocation
impl PartialEq for Revocation
impl StructuralPartialEq for Revocation
Auto Trait Implementations§
impl Freeze for Revocation
impl RefUnwindSafe for Revocation
impl Send for Revocation
impl Sync for Revocation
impl Unpin for Revocation
impl UnsafeUnpin for Revocation
impl UnwindSafe for Revocation
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more