Where a device's private key is created decides how bad a breach can get.
There are two common ways to give a device its identity. The cloud generates the key and certificate and sends them down. Or the device generates its own key pair and asks a CA to sign it with a certificate signing request (CSR).
I prefer the second, and who does what matters:
- The device generates the key pair. Ideally in hardware that will not export it, such as a secure element or TPM. A protected software keystore also works, with a weaker guarantee.
- The device builds a CSR and signs it with its own key. Standard libraries do this, so nobody hand-rolls it.
- The CA signs and returns the certificate. It sees the public key and identity only.
- The device connects with mutual TLS. Its own certificate, plus the CA certificate as trust anchor, so each side validates the other.
Hardware raises the cost of stealing the key. It does not change the design.
When enrollment happens is a design decision:
- At the factory. The line triggers enrollment, so each unit ships with an identity. The issuing CA key now lives in your manufacturing process, which is a reason to keep it in an HSM.
- At first boot or in the field. The device enrolls over a protocol such as EST. That needs a bootstrap trust step, for example a vendor-provisioned certificate that proves the chip is genuine.
Treat keys and certificates as assets in the threat model: stolen, spoofed, expired, rotated. Each needs an answer. The details that decide whether it holds up:
- A CSR proves possession, not legitimacy. The bootstrap step is what establishes legitimacy.
- Expiry checks need a trustworthy clock. A device with no RTC or bad time rejects valid certificates or accepts expired ones.
- Revocation is hard on intermittent links. CRLs and OCSP are often impractical, so many fleets enforce revocation at the broker by certificate ID.
- Short-lived certificates reduce reliance on revocation, but only if renewal is reliable.
- CA rotation needs an overlap. Devices trust old and new, delivered through the signed update path.
- Brownfield units without a secure element can still enroll with a software key. It is weaker, and the trade-off belongs in the risk file.
For a medical device, what happens when identity fails is a safety question as well as a security one.
The test: if your CA certificate rotates next month, what does a device in the field do?
If the answer is "we would have to visit it", design that first.
Seen this differently?
Questions, corrections and counterexamples are welcome.


