Expand description
Small X.509 helpers shared by the certificate revocation paths: the ACME
POST /revokeCert handler (handlers::post_revoke_cert) and the order revoke admin CLI command (admin::revoke_order). Both need to
pull a certificate’s serial/public key out of raw DER, and pull the leaf
back out of a stored leaf + CA PEM chain, so the parsing lives here once
rather than twice.
Structs§
- AriCert
Id - The two halves of an ACME Renewal Information certID (RFC 9773 §4.1),
decoded:
base64url(AKI keyIdentifier) "." base64url(serial).
Constants§
- ALLOWED_
REVOCATION_ REASONS - RFC 5280 §5.3.1
CRLReasoncodes RFC 8555 §7.6 permits in a revocation request’sreason— every value except the reserved7. Shared withrcgen::RevocationReason’s own numbering (seesigner::local_ca).
Functions§
- ari_
cert_ id - The ACME Renewal Information certificate identifier (RFC 9773 §4.1) for a
DER-encoded certificate:
base64url(AKI keyIdentifier) || "." || base64url(serial), both unpadded. - ari_
cert_ id_ parts - The raw
(AKI keyIdentifier, serial)bytes behindari_cert_id, for callers that want to compare the halves rather than the rendered string. - cert_
serial_ and_ spki - Extracts a single certificate’s serial (hex-encoded, no separators) and
the DER encoding of its
SubjectPublicKeyInfofrom raw X.509 DER bytes. - cert_
validity - Extracts the validity period (notBefore, notAfter) from a DER-encoded certificate as UNIX timestamps (seconds since epoch).
- is_
valid_ revocation_ reason - Whether
reasonis one of theCRLReasoncodes RFC 8555 §7.6 permits. - issuer_
id - The identity a local CA’s revocation state is stored under: lowercase hex
SHA-256 of the CA certificate’s
SubjectPublicKeyInfoDER. - leaf_
der_ from_ chain - Extracts the leaf certificate’s DER bytes from a
leaf + CAPEM chain (the shapeSignerBackend::issuereturns andorders.certificatestores) — the firstCERTIFICATEblock, mirroringcrate::pemfile::read_certificates’s label-agnostic PEM iterator. - normalize_
serial - Folds an operator-supplied certificate serial into the form the column holds: lowercase hex, no separators.
- parse_
ari_ cert_ id - Parses an inbound certID (RFC 9773 §4.1).
- subject_
key_ identifier - A certificate’s
SubjectKeyIdentifierextension, when it carries one.