PQC PKI for AI
A post-quantum public-key cryptography infrastructure stack built for AI factories and their workloads: certificate issuance, real-time revocation checking and trusted timestamping, all using NIST-standardised post-quantum algorithms.
A major goal is to let automated agents and code that operate under AI control request and use PKI services in the most robust and safe way possible, without sacrificing productivity at scale. The APIs and workflows are built so that machines can enrol, renew, check status and timestamp evidence automatically, while the security controls remain strict enough for high-stakes AI factory environments.
At a glance
Post-quantum cryptography (PQC) PKI for AI is a post-quantum public-key infrastructure stack built for AI factories and their workloads. It provides certificate issuance, real-time revocation checking and trusted timestamping, all using NIST-standardised post-quantum algorithms. The stack is designed to be exposed to the Internet directly, operated through APIs, and scaled to thousands of operations per second.
Automation may include the utilisation of SCEP, the Simple Certificate Enrolment Protocol. Enrolment requests are evaluated against pre-compiled certificate profiles rather than parsed at runtime. Compiling profiles ahead of time gives fast, deterministic issuance and removes an entire class of runtime policy errors. A dedicated policy compiler turns YAML policy definitions into signed, hashed binary objects that the signing components accept.
The stack consists of three foundations, provided as separate code packages:
- bastion-pki, a post-quantum certificate authority.
- bastion-ocspd, a high-performance OCSP responder.
- bastion-tsa-server, an RFC 3161 time-stamp authority.
The code for all three foundations is written in C++ and developed according to secure-coding standards, with memory-safe patterns, strict input validation, hardening flags and exploit mitigations built into every release. All three code packages are released under the Apache License 2.0.
Together they give AI factories, model-serving endpoints, data guards and customers the cryptographic identities, status checks and timestamped evidence needed for a zero-trust, post-quantum environment.
The three foundations in detail
bastion-pki
bastion-pki is a certificate authority written in C++23, designed primarily for small and mid-size enterprises, with a modular design that can be extended to cover the needs of large enterprises. It is built for post-quantum signatures from the root down.
The reference hierarchy has an offline ML-DSA-87 root, two ML-DSA-65 subordinate CAs, and one issuing CA under the first subordinate. RSA and ECDSA CAs are supported only for keys imported from an existing PKI.
The design goal is that no single person, and no single compromised host, can issue a certificate the officers did not approve, undo a revocation, or take a CA key. Every rule that decides what is signed lives in the signer, which has no network and is reached only through a Unix socket. Everything in front of it, including the admin API, the publisher and the object store, is treated as untrusted.
- Offline root operated in ceremonies, with requests and results carried on transfer media.
- Subordinate signers without a network, reached only through a Unix socket.
- At least three security officers per CA; the officer who assembles a request counts as one approval.
- Signer-issued challenges, single-use request IDs, and approvals bound to the CA key, the profile set and the requester.
- Certificate profiles compiled from YAML into deterministic binary objects, pinned by hash in the signer.
- One signing object per certificate, containing the complete certificate content, computed independently by the RA, the approving officer and the signer.
- Hash-chained journal with signed checkpoints, witnesses and rollback detection.
- Revocation with certificateHold and release; every CRL is a superset of the previous one.
- OCSP served by bastion-ocspd from the CA's CRL only.
- 2-of-n backup of the CA key, sealed to each officer's ML-KEM-1024 key, and journaled restore.
- Automated issuance through compiled rules with API keys, limits and an end date.
- SCEP (RFC 8894) enrolment for devices.
- Publication of CA certificates and CRLs through 389 Directory Server over LDAPS.
bastion-ocspd
bastion-ocspd is a hardened, high-performance OCSP responder written in C++20 on top of OpenSSL 3. It is built to face the Internet directly.
One process serves any number of independent Certificate Authorities, each with its own delegated responder. Responses are signed on a pool of worker threads, and signing capacity is shared fairly between issuers and clients under attack.
- RFC 6960 compliant OCSP responder.
- Multiple independent CAs in one process, each with its own delegated responder.
- Per-CA chain validation against a pinned trust anchor.
- CRL validation, rollback protection and hot reload without dropping requests.
- Explicit error answers: unauthorized for unknown CAs, malformedRequest for unsupported CertIDs, tryLater when the CRL is past its nextUpdate.
- Post-quantum delegated responders with OpenSSL 3.5+: ML-DSA and SLH-DSA, per CA, alongside ECDSA CAs.
- HTTP POST and GET, with GET answers carrying RFC 5019 cache headers.
- Pre-signed responses for serials the CA has issued, so floods of distinct serials cost no signature.
- Built for direct Internet exposure: non-blocking request reading, strict HTTP parsing, per-client rate and connection limits, allow and deny lists, and a signed-response cache.
- Admin API over mutual TLS 1.3 to onboard CAs, rotate chains and responders, and decommission CAs.
- Prometheus metrics on a separate listener.
bastion-tsa-server
bastion-tsa-server is an RFC 3161 Time-Stamp Authority built for direct Internet exposure. It runs several named signers side by side, including ECDSA, RSA, Ed25519, and post-quantum ML-DSA or SLH-DSA.
Clients POST a DER TimeStampReq to /tsa/<signer id> and receive a TimeStampResp. Each signer has its own key, TSA certificate, issuer chain pinned to a trust anchor, policy OID, accuracy and accepted digests.
- Multiple signers in one server, each independently configurable and rotatable.
- Post-quantum ML-DSA and SLH-DSA signers alongside classical ones.
- Admin API over mutual TLS 1.3 for installing and rotating signers at runtime.
- Degraded mode: the server starts and stays manageable even when no signer is usable.
- Tokens issued only while the clock is synchronised and within the signer's accuracy.
- HSM support through PKCS#11.
- Prometheus metrics and readiness endpoint.
Post-quantum cryptography
The stack uses the NIST post-quantum standards as implemented in OpenSSL 3.5:
This means certificates, revocation responses and timestamps can be verified by relying parties that are preparing for a post-quantum world, while classical algorithms remain available for backwards compatibility during transition.
Relevance to AI factories
AI factories handle sensitive training data, model weights, inference requests and customer agreements. A PKI for such an environment must do more than issue TLS certificates:
Identity for data guards and model-serving endpoints
Each component can receive a short-lived, post-quantum certificate tied to a tenant or a customer contract.
Revocation that keeps up
bastion-ocspd answers status requests in real time, so a compromised endpoint can be blocked without waiting for a CRL to propagate.
Timestamped evidence
bastion-tsa-server provides RFC 3161 timestamps for model releases, dataset versions, audit log entries and signed customer agreements.
Cross-federation trust
The CA hierarchy, OCSP responders and TSA can be shared by a federation of AI factories, each running its own contract store and validators, with one root of trust.
API access and automation
The stack is built for API-driven operation.
- Admin API over mutual TLS 1.3 for officers and automation.
- Enrolment listener for automated certificate issuance by rule.
- SCEP listener for device enrolment.
- Admin API over mutual TLS 1.3 to onboard CAs and rotate responders at runtime.
- Public OCSP endpoint over HTTP.
- Admin API over mutual TLS 1.3 to create signers, generate keys, upload certificates and activate generations.
- Public timestamp endpoint.
All admin APIs use TLS 1.3 with client certificates, and every change is logged with the client's common name.
Performance
bastion-ocspd and bastion-tsa-server are designed for high-throughput, low-latency environments.
On server-class hardware, bastion-ocspd scales with worker threads and event loops; the exact throughput depends on the responder key type and the fraction of requests that can be answered from the pre-signed cache.
On a server with 2 x AMD EPYC 7H12 (128 cores), with the load generator on a second node over InfiniBand:
| Signer key | Timestamp tokens per second |
|---|---|
| ECDSA P-256 | about 135,000 |
| Ed25519 | about 137,000 |
| ECDSA P-384 | about 64,000 |
| ML-DSA-44 / -65 / -87 | about 20,200 / 12,800 / 11,500 |
| RSA 3072 | about 12,000 |
| SLH-DSA-SHA2-128f / -128s | about 3,600 / 160 |
This makes the TSA suitable for high-volume timestamping of inference logs, model checkpoints and audit events.
Security design
The stack follows a bastion model: the hardened parts face the network, while the keys stay behind.
- CA keys live in signers with no network access, reached only through Unix sockets.
- Responder and TSA keys live in OpenSSL's secure heap, locked in memory and excluded from core dumps.
- Admin APIs require mutual TLS 1.3 with authorised client certificates.
- Every signing decision is independently verified by the signer, the officer tool and the RA.
- Journals are hash-chained and checkpointed, with rollback detection.
- Backups are split with Shamir's scheme and sealed to officers' ML-KEM-1024 custody keys.
- Builds use hardening flags and exploit mitigations: PIE, full RELRO, stack protector, fortified libc calls and CET markings on x86_64.
Secure-coding practices for each component are documented explicitly:
Deployment
The components are built with CMake and installed under /opt/<component>-<version> by default. They are designed to run and be operated as non-root users: each service runs under its own unprivileged account in a hardened systemd unit, and routine administration is done without root access. This non-root design removes a common privilege escalation path and strengthens the overall product.
Container images are built with Podman, pinned by image ID, and deployed with firewall rules in a dedicated nftables table.
pkisignruns the signers on a volume of their own.pkidevruns the admin API and directory server.pkipubruns the responders and repositories that face the network.