Certificate Store Integration Guide
Purpose
This guide describes how a platform integrator configures and integrates the Caliptra MCU certificate store.
Before integrating the store, review:
- Caliptra Certificate Model for the trust model, endorsement roles, certificate algorithms, and chain composition.
- Caliptra MCU Certificate Store for certificate-store design and behavioral requirements.
- In-field Certificate Provisioning and Management for Owner and Tenant endorsement lifecycles.
- External Mailbox Commands for MCI mailbox command definitions.
Integration sequence
Integrate the certificate store through the following steps:
- Define the platform profile (algorithms, slots, PKI anchor points, and managed storage).
- Provide Vendor certificates (Root CA and IDevID certificates).
- Configure transport exposure (SPDM and MCI).
- Configure authorization.
- Initialize the certificate store before starting responders.
- Validate the integration.
Define the platform profile
The platform profile defines static configuration for the lifetime of the certificate store:
| Configuration | Platform selection | Behavior |
|---|---|---|
| Algorithm profile | ECC P-384 only, or ECC P-384 plus ML-DSA-87 | ECC P-384 is always enabled; ML-DSA-87 is enabled when post-quantum support is configured. |
| Slot enablement | Enablement of Vendor, Owner, and Tenant slots | Vendor is always enabled (read-only by default, or optionally configured as a managed endorsement slot). Owner and Tenant are optional managed slots. |
| PKI anchor points | Caliptra identity key certified by endorsements | Vendor binds to IDevID. Owner and Tenant can each be configured with a fixed key anchor point or left without a fixed key anchor point (in the default configuration, Owner uses LDevID and Tenant has no fixed key anchor point). |
| Endorsement backing | Storage allocation and size limits per managed role | Independent backing and size limits for each algorithm in Owner and Tenant. |
Select the certificate algorithm profile
- ECC P-384: Mandatory and enabled for all active slots.
- ML-DSA-87: Configured when post-quantum support is required. When enabled, each active slot supports both ECC P-384 and ML-DSA-87 chains independently.
Select PKI anchor points
The platform configures the static provisioning policy in the certificate store for each managed role (Owner and Tenant):
- Fixed key anchor point (for example, Owner is configured with LDevID in
the default policy): pins the role to that identity key.
key_pair_id = 0resolves to the configured key anchor point, and any nonzerokey_pair_idmust match it. - No fixed key anchor point (for example, Tenant in the default policy):
allows any supported key anchor point when a nonzero
key_pair_idis provided;key_pair_id = 0is rejected.
SPDM SET_CERTIFICATE passes key_pair_id = 0 when the request has no
KeyPairID field (SPDM 1.2, or SPDM 1.3+ with MULTI_KEY_CONN_RSP = 0) and
passes the request's KeyPairID when MULTI_KEY_CONN_RSP = 1. MCI mailbox commands must always provide a nonzero key_pair_id.
Currently only LDevID (key_pair_id = 1) is a supported managed key anchor
point; FMC Alias (2) and RT Alias (3) are rejected as unsupported.
Integrators are responsible for validating certificate contents, required extensions, and public-key binding to the selected key anchor point.
Allocate managed endorsement storage
For each enabled managed slot (Owner and Tenant), the platform must allocate persistent storage (such as dedicated flash partitions) and configure size limits:
- Algorithm independence: ECC P-384 and ML-DSA-87 must use disjoint, non-overlapping storage regions.
- Role independence: Owner and Tenant must use disjoint storage regions.
- Sizing: Allocate sufficient space for the configured maximum endorsement size plus storage metadata and double-buffering.
- Persistence guarantees: Storage must ensure atomic commits while keeping the active endorsement readable during updates, power-loss safety, deterministic recovery of the newest valid endorsement, and durable removal.
SDK reference implementation
caliptra-mcu-cert-store owns the managed endorsement record format, A/B
ping-pong staging, checksum verification, and startup recovery
(ManagedEndorsementChain<S>) over the platform-agnostic EndorsementStorage
trait (is_available, read, write, erase), while the reference
implementation provides SpiFlashEndorsementStorage (user/src/cert_store/mod.rs):
- Partition and A/B region layout: In the reference implementation, the
512 KiBcertificate-store partition is divided into four disjoint128 KiB(role, algorithm)allocations (Owner/Tenant×ECC P-384/ML-DSA-87). Each allocation is split into two equal64 KiBA/B flash regions (active_regionandstaging_region,MANAGED_REGION_COUNT = 2). - Active-chain continuity: Single-shot and multi-chunk
SET_CERTIFICATEwrites erase and program thestaging_regionwhile concurrent readers continue reading theactive_region(RegionReadGuardprevents erasing a region while a reader is in flight). - Record metadata and recovery: Each A/B region stores a DER endorsement
chain preceded by an 80-byte
ManagedRecordheader (format version 2). The header identifies the chain and contains certificate metadata, integrity checks, and an update sequence number. Recovery verifies the header CRC and payload checksum, then selects the valid region with the highest sequence number. The DER payload is written and checksum-verified before the header is written and read-back verified. - Durable removal:
eraseclears the olderstaging_regionbefore theactive_regionso an interrupted erase cannot resurrect a superseded chain after reset. A failed erase recovers any surviving valid record before allowing another update. If recovery also fails, the slot remains unprovisioned and locked against updates until startup recovery after reset.
Provide Vendor certificates
The Vendor slot (EndorsementRole::Vendor, Slot 0) binds to IDevID (key_pair_id = 0) and supports three configuration modes:
- Default read-only (in-band Root/Int CA + OTP
IDevID):- In-band CA chain: Embed the Vendor Root and Intermediate CA certificates
in the application image and register them with
init_readonly_endorsement. - Boot-time
IDevIDpopulation (normal flow): Read the manufacturing-signedIDevIDcertificates from OTP and pass them to Caliptra Core viapopulate_idev_ecc384_cert/populate_idev_mldsa87_certbefore callinginit_readonly_endorsement. - Manufacturing-time
IDevIDprovisioning (cert-provisioning): When OTP is unpopulated at boot during manufacturing,ProvisionIdevCert(MC_PROVISION_IDEV_CERT/ SPDM VDM0x09) can either:PopulateOnly: PopulateIDevIDinto Caliptra Core for the current boot without modifying OTP.WriteOtp: Burn, readback-verify, and lock the OTP partition first, then populateIDevIDinto Caliptra Core.
- In-band CA chain: Embed the Vendor Root and Intermediate CA certificates
in the application image and register them with
- Managed Vendor CA chain (flash-backed Root/Int CA + OTP
IDevID): For platforms that store the Vendor Root and Intermediate CA chain in persistent storage rather than embedding it in the runtime image, allocate anEndorsementStorageregion and registerEndorsementRole::Vendorwithinit_managed_endorsement(vendor_auth_requireddefaults totrue, requiring aVendorOwner- orOwner-signedMC_AUTH_SET_CERT_CHAINbeforeMC_SET_CERT_CHAINor SPDMSET_CERTIFICATE). - All Vendor certificates out-of-band (
vendor-certs-oob): For deployments where the verifier holds the Vendor CA chain andIDevIDout-of-band, skipPOPULATE_IDEV_*and callinit_oob_endorsement. Slot 0 servesLDevID -> FMC -> RT -> DPE LeafwithRootHash = SHA-384(LDevID)(enabled in the reference user app via thevendor-certs-oobCargo feature).
Configure transport exposure
All enabled transports share the single initialized SharedCertStore<S> instance
via per-task TaskCertStore<S> handles:
- SPDM responder: Pass
TaskCertStore<S>intoMcuSpdmPal<M, S>(SpdmPalCertStore), mapping negotiated algorithms and SPDM SlotIDs (default: Slot 0 Vendor, Slot 2 Owner, Slot 3 Tenant) and advertising only available provisioned chains. - MCI mailbox responder: Use a dedicated
TaskCertStore<S>to serviceMC_GET_CERT_CHAIN_INFO,MC_GET_CERT_CHAIN, andMC_SET_CERT_CHAINby(EndorsementRole, CertificateAlgorithm). Command formats are defined in External Mailbox Commands.
Configure authorization
Read-only Vendor slots (init_readonly_endorsement / init_oob_endorsement)
reject all write and erase requests.
For managed endorsement slots (Vendor when initialized with
init_managed_endorsement, Owner, and Tenant), platforms control write
authorization via CertificateProvisioningPolicy (vendor_auth_required = true,
owner.auth_required = true, and tenant.auth_required = false by default) and
SharedCertStore::set_auth_required(role, required). Owner and Tenant each use
RoleProvisioningPolicy to group anchor_point and auth_required; Vendor's
IDevID anchor is fixed, so only its authorization flag is configurable:
- Manifest-backed pre-authorization (
MC_AUTH_SET_CERT_CHAIN,0x4D41_5343/"MASC"): Submitted viaAuthorizedCommand(0x12) over MCI mailbox or SPDM VDM.Vendor(Slot 0) acceptsCommandAuthority::VendorOwner(1, base SoC Manifest keyV_AUTH_KEY_ID, IME0x4) orCommandAuthority::Owner(2, Owner SoC Manifest keyO_AUTH_KEY_ID, IME0x6).Owner(Slot 1) requiresCommandAuthority::Owner(2), verified against the Owner SoC Manifest key (O_AUTH_KEY_ID, IME0x6).Tenant(Slot 2) has no manifest-backed authority and is allowed withoutMC_AUTH_SET_CERT_CHAINby default (tenant.auth_required = false).
- Armed-write binding (
arm_endorsement_write): A validMC_AUTH_SET_CERT_CHAINarms a single write or erase for(role, algorithm)bound tototal_sizeandexpected_sha384. - Transport-consistent enforcement: Both
MC_SET_CERT_CHAIN(MCI mailbox) andSET_CERTIFICATE(SPDM) require a matching armed state whenauth_requiredis enabled, claim that grant at admission, keep the claimed authorization across multi-chunk streams, verify the staged DER SHA-384 digest againstexpected_sha384before switching the active region. Claimed grants are never returned for reuse.
Update ownership and restart
The store separates an executing operation from an open multi-chunk stream:
- A per-
(role, algorithm)operation guard covers validation, hashing, storage I/O, and shared-state publication. Concurrent mutations, aborts, and re-arms returnSTORAGE_BUSYbefore changing state. If an executing future is cancelled, the slot remains locked until reset because I/O may still be outstanding. - Between chunks the guard is released, but the stream retains its expected key, size, next offset, and claimed grant. A valid re-arm can abandon this idle stream uniformly for MCI and SPDM. Other writes cannot displace it, except an MCI offset-zero restart through its owning task view; authorization-required restarts need a fresh grant.
- Each task view retains the generation of its admitted stream. A stale
continuation, finish, or abort from another task cannot mutate a replacement
stream or consume a newly pending grant. Use a dedicated, sequential
TaskCertStoreper responder; do not share one view between independent transfer contexts.
Protocol identity remains outside the store: SPDM checks chunk handles and sequences; MCTP checks packet assembly identity. Neither supplies a transfer ID for raw MCI certificate chunks. MCI callers must serialize updates and retire old requests before restarting; see MC_SET_CERT_CHAIN.
Initialize the certificate store
The application calls cert_store::init(...) once during startup:
- Imports Vendor IDevID certificates and configures the Vendor slot.
- Recovers persisted Owner and Tenant endorsements that match the provisioning policy.
- Computes available certificate chains.
- Shares the initialized store across SPDM and MCI responders.
Responder tasks (SPDM MCTP, SPDM DOE, MCI mailbox) must start only after
cert_store::init(...) succeeds. If initialization of the mandatory Vendor ECC
P-384 chain fails, startup must halt.
Validate the integration
Verify the integrated certificate store:
- Chain retrieval: Retrieve complete chains across all enabled transports
(
GET_CERTIFICATEon SPDM,MC_GET_CERT_CHAIN_INFO/MC_GET_CERT_CHAINon MCI) and verify they match expectations from Root CA to DPE leaf. - Attestation: Verify attestation challenges (
CHALLENGEon SPDM,MC_GET_ATTESTATIONon MCI) against the retrieved leaf certificate. - Availability: Confirm that unprovisioned or failed chains are not advertised.
- Independent updates: Verify that updating an Owner endorsement does not affect ML-DSA or Tenant chains.
- Atomic updates: Verify that a failed or interrupted update leaves the previous valid endorsement intact.
- Cross-transport consistency: Confirm that an update made via one transport
(
SET_CERTIFICATEorMC_SET_CERT_CHAIN) is immediately visible on all other transports. - Authorization enforcement: Verify that unauthorized update attempts
and writes to the Vendor slot (
role = 0) are rejected without altering stored state.