CRL Signing Approach: Export CA Key vs KMIP Sign
Docs for PKI Manager 3.17.0 (released 2026-11-24), from main 4d59c30 (30 commits after the release). Page last changed in 2.0.0.
Source:
backlog/decisions/decision-010 - CRL-Signing-Approach-Export-CA-Key-vs-KMIP-Sign.md
- Status: Accepted
- Date: 2026-06-29
- Task: TASK-110 (milestone: CRL Signing & Distribution)
- Deciders: Backend / PKI
Context
Section titled “Context”CRL signing was unimplemented: crl.service.ts stored crl_pem = '' and the public
GET /crl/:caId.crl returned 503. The CA private key lives in the Cosmian KMS
(TASK-109.22), so signing a CRL faces the same fork as certificate signing:
- (a) KMIP
Signover the DER-encodedTBSCertList— the CA key never leaves the KMS. This is the security-preferred option and the documented default for TASK-110. - (b) Export the CA key via the KMIP
Get(KMSgetPrivateKey) and sign offline withnode-forge— simpler, reuses the existingcrypto/crl.tsCRL builder, but the CA private key transits backend memory.
For certificates the project uses a third option that has no CRL analogue: the KMIP
Certify operation, which signs an X.509 certificate server-side. CRLs are not
certificates, so Certify cannot produce them.
Investigation (the spike)
Section titled “Investigation (the spike)”backend/src/kms/spike-crl-sign.ts probed a live Cosmian KMS 5.24.0 for the KMIP
Sign operation:
Query(QueryOperations)advertises bothSignandSignatureVerify.- But
Signagainst a freshly created RSA-2048 private key returns422 Item_Not_Found: Sign: no valid key for id: <id>. - The same
Signagainst an ECDSA P-256 private key fails identically. - Re-creating the RSA key with the explicit KMIP
Signusage-mask bit does not help.
Conclusion: Cosmian 5.24 exposes Sign/SignatureVerify only for its
post-quantum / Covercrypt key types, not for the classical RSA/ECDSA keys our CAs
use. Option (a) is therefore not viable with the KMS we run. (A raw-RSA-via-Decrypt
trick to emulate signing was considered and rejected as fragile and padding-dependent.)
Decision
Section titled “Decision”Adopt approach (b): export the CA private key from the KMS for the duration of a CRL
build and sign the TBSCertList with node-forge (crypto/crl.ts).
This is consistent with the existing codebase, not a new weakening: getPrivateKey
is already used by ca.routes.ts (PKCS#12/PEM bundle export), bulk.routes.ts, and
certificate.routes.ts. The strict “CA key stays in the KMS” guarantee already applies
only to the external /sign Certify path, which is unaffected by this decision.
Threat-model rationale
Section titled “Threat-model rationale”- The CA private key is exported in memory only, for the duration of one CRL generation, and is never written to disk or returned to any client.
- Every export is recorded in
audit_logviakms.get_private_key(success and failure), and CRL generation writes its owncrl.generateaudit row. - The exposure window is identical to existing CA-bundle/keystore export paths, so the blast radius is unchanged from the already-accepted baseline.
- In the dev KMS, keys are returned
AsRegistered(unwrapped); a production deployment can wrap exports, but the signing code path is the same.
Consequences / future path
Section titled “Consequences / future path”crl.service.tscallskmsService.getPrivateKey(ca.kmsKeyId, ca.id)andgenerateCRL()to produce a real, openssl-verifiable X.509 v2 CRL (TASK-111).- If a future Cosmian release implements
Signfor RSA/ECDSA — or if CA keys move to a post-quantum scheme thatSignalready supports — CRL signing can switch to option (a) by replacing thegetPrivateKey+node-forgeblock with a KMSsign()call, with no change to callers or the served CRL format.
Verification
Section titled “Verification”The chosen approach produces a valid CRL (TASK-110 AC#2): openssl crl -noout -text
parses it and openssl verifies its signature against the issuing CA certificate. See
TASK-111 for the implementation and its tests.
PKI Manager is a personal project of Oriol Rius, built for his own use. It is not a commercial product. About this project