Keep production firmware signing keys in a hardware security module or a cloud key service, never on laptops, build servers or CI runners. Let CI request a signature only after a named person approves the release, record every signature, and keep development keys separate so production devices refuse them. Rotation and revocation are decided by your chip and bootloader before the first unit ships: if a device trusts only one key and that key leaks, no software release can re-key the units already in the field.
This article sizes firmware signing key management for a startup with one product and a small team. It covers which keys you need, where to keep them, how to sign in CI without exposing them, what MCUboot and Espressif’s Secure Boot V2 allow when a key must change, and a one-page key policy you can adopt. Vendor and standards documents were checked in November 2026. Nothing here is legal or regulatory advice.
What a firmware signing key controls
A firmware signing key is the private half of a key pair whose public half your devices trust: any image signed with it will install and run. Whoever can produce a signature with that key can put code on every device you have shipped, so the question is not only where the key lives but who can cause it to sign.
Four terms, defined once:
- The private key signs images. It must stay secret.
- The public key verifies signatures. It is built into the bootloader, or its hash is written into one-time-programmable memory (eFuses or OTP, bits that can be set once and never cleared).
- The trust anchor is whatever the device ultimately trusts: that public key or key hash. Changing it is the hard part of rotation.
- A key hash or digest is a short fingerprint of a public key. Chips store the hash because it takes less one-time memory than the key.
The IETF’s manifest information model for firmware updates, RFC 9124 (January 2022), describes the threat plainly. If a third party obtains a key “or even indirect access to a key”, for example through a hardware security module, “then they can perform the same actions as the legitimate owner of the key”. Its example: if signing runs on a server connected to the internet, “an attacker may compromise the server and then be able to sign manifests, even if the keys for manifest signing are held in an HSM that is accessed by the server.”
That sentence shapes everything below. An HSM stops a key from being copied. It does not stop a compromised build server from asking the HSM to sign malware. Storage and approval are two separate controls, and you need both.
The keys a small hardware company actually needs
A startup with one product usually needs three kinds of key: a development key for bench builds, one production key that signs releases, and a reserve production key that the devices already trust but that nobody uses until the first one must be retired. Write them down in a key inventory before you generate any of them.
NIST calls such a list a key inventory: “information about each key that does not include the key itself (e.g., the key owner, key type, algorithm, application and expiration date).” For a firmware team it fits on one page.
| Key | Where it lives | Who can use it | What it signs | What trusts it |
|---|---|---|---|---|
| Development | A file on build machines and laptops | Any engineer | Bench and test builds | Development boards only |
| Production, primary | HSM or cloud key service | CI, after a named approval | Release images | Every production device |
| Production, reserve | Offline, on hardware tokens or in a second key service | Nobody, until a rotation | Nothing yet | Every production device |
| Per-device identity keys | Inside each device | The device itself | Device authentication, not firmware | Your cloud service |
Development keys are public by design
MCUboot ships a development key so that samples work out of the box. Its imgtool documentation says: “Since this private key is widely distributed, it should never be used for production.” Zephyr’s signing documentation warns that its default key setting points at one of these keys, and that they “are public” because they “ship with every Zephyr and MCUboot checkout”.
Generate your own development key anyway. Then make sure the production bootloader does not trust it. The secure boot checklist includes the test: an image signed with the development key must be refused by a production unit.
Device identity keys are a different problem
Each device’s own key, used to prove to your cloud that it is unit 1042, is not a firmware signing key. It is created or injected per unit at the factory and never leaves the device. Factory provisioning covers how those keys get there; this article covers the keys that sign firmware.
Where to keep the production key
Keep the production private key in a device or service that signs without ever exporting the key: a cloud key service backed by hardware security modules for teams that release from CI, or hardware tokens in a locked, offline procedure for teams that release rarely. A key file with a passphrase on a laptop is not a production option, because copies spread and nothing records their use.
| Option | What protects the key | Who can sign | Fits when | Watch out for |
|---|---|---|---|---|
| Key file on a laptop or in CI secrets | A passphrase, if one was set | Anyone with the file and passphrase | Development keys only | Copies in backups, chat and old runners; no record of use |
| Offline signing computer with hardware tokens | Non-exportable keys on the tokens; physical custody | Holders of a token and its PIN | A few releases a year; no cloud account you trust | Manual steps; one token is one point of loss |
| Cloud key service backed by HSMs | The provider’s validated HSMs and your identity policies | Roles you grant; every call logged | Releases signed from CI | Account security becomes key security; deletion is permanent |
| Your own HSM appliance | The HSM and your physical controls | Users you configure on the HSM | Regulated products or very large fleets | Cost, operation and backup of key material |
What a cloud key service gives you
The AWS Key Management Service describes its keys as “protected by FIPS 140-3 Security Level 3 validated hardware security modules”, and says they “never leave AWS KMS unencrypted”. It is integrated with CloudTrail, which “records all calls to AWS KMS by users, roles, and other AWS services”, so every signature leaves a log entry.
As of November 2026, AWS lists asymmetric signing key types including RSA-2048, RSA-3072, ECC NIST P-256 and Ed25519 (plus the post-quantum ML-DSA family). Google Cloud KMS lists P-256, Ed25519 and RSA-PSS 3072 among its signing algorithms, and its Cloud HSM page describes “FIPS 140-2 Level 3 certified HSMs”. Those overlap with the four key types MCUboot’s imgtool supports: “rsa-2048, rsa-3072, ecdsa-p256 and ed25519”.
One property cuts both ways: deletion. AWS calls deleting a key “destructive and potentially dangerous” and “irreversible”, and enforces a waiting period of 7 to 30 days. A deleted signing key means devices can never accept another update signed with it. Restrict who can schedule deletion, and alert on it.
What FIPS 140-3 means, and does not
FIPS 140-3 is the US federal standard for cryptographic modules, and the program that validates modules against it is run jointly by NIST and the Canadian Centre for Cyber Security. It “provides four increasing, qualitative levels of security” covering areas such as roles and authentication, physical security, self-tests and the management of sensitive parameters. A validated module has passed testing by an accredited lab and appears on NIST’s list; validation says nothing about how your team uses it.
The Cryptographic Module Validation Program states that FIPS 140-2 modules could be accepted by US and Canadian federal agencies “through September 21, 2026”, after which they move to the Historical list, usable “for existing systems only”. If a customer or regulator asks about validation, check the vendor’s current certificate rather than a marketing page.
Generating keys: a short ceremony
A key ceremony is the recorded event at which production keys are created. For a startup it takes about an hour, two people, one machine you trust and a written record. Espressif’s Secure Boot V2 guide gives the core rules: generate the key “on a system with a quality source of entropy”, keep it private “at all times”, and let no third party observe key generation or signing, because “both processes are vulnerable to timing or other side-channel attacks”.
- Two people are present. One runs the steps; the other reads each step aloud and checks it.
- The primary key is created where it will live, inside the key service or HSM, so it never exists anywhere else.
- The reserve key is created offline and written to hardware tokens; then the offline machine’s copy is destroyed.
- Each public key is exported and fingerprinted. Its hash is computed, read aloud and written into the record.
- The record is completed: date, place, people, key IDs, algorithms, public key hashes and token serial numbers. It contains nothing secret, so it can live with the release documents.
Tokens have PINs, and PINs have to be stored somewhere. NIST SP 800-57 describes split knowledge, where a key is divided into shares “each of which provides no knowledge of the key”. A small team can apply the same idea more simply: keep each token and its PIN in different places, held by different people, so that no one person can use the reserve alone.
Example (fictional). Loamwick’s LW-1 probe verifies ECDSA P-256 signatures in MCUboot. At the key ceremony, the CTO creates the primary production key inside a cloud key service in Loamwick’s own account; it cannot be exported. The reserve production key is generated on an offline laptop booted from read-only media, copied to two hardware tokens and wiped from the laptop. One token goes to the CTO’s safe, one to a co-founder’s bank box. Both public keys go into the bootloader build. The ceremony record lists date, people present, key IDs, public key hashes and token serial numbers, and nothing secret.
Signing in CI without putting the key in CI
Let CI build the image and compute its digest, send only the digest to the signing service, and attach the returned signature to the image. The private key never touches the runner, and a compromised runner can at most request a signature that an approval step and a log will catch.
The default build flows do the opposite. Zephyr’s sysbuild passes the key file to imgtool during the build, and Espressif’s Secure Boot V2 guide says the default configuration keeps “the signing key on the build machine”. Both projects document how to sign elsewhere.
The flow, step by step
- Build from a tagged commit on a CI runner. Record the commit, toolchain and version.
- Export what must be signed. imgtool’s
--vector-to-signoption writes out “the payload or payloads digest instead of complied image”, for “external image signing”. On ESP-IDF, build with signed binaries turned off; Espressif documents signing with a remote server, with “pre-calculated signatures” and with an external HSM. - Approve. A named person other than the author of the release approves the signing job.
- Sign the digest in the signing service. AWS’s Sign operation accepts messages of up to 4,096 bytes and says to “provide a message digest” for anything larger, which is why you send the digest rather than the image.
- Insert and verify. imgtool accepts an externally computed signature through its
--fix-sigand--fix-sig-pubkeyoptions. Verify the result with the public key before publishing. - Record the release: version, image digest, key ID, approver, time and the signing service’s log reference.
No long-lived cloud credentials in CI either
If the runner holds a permanent access key for the signing service, that credential becomes the thing to steal. GitHub’s OpenID Connect support lets a workflow “request a short-lived access token directly from the cloud provider”, valid “only for a single job”, so there are no long-lived cloud secrets stored in the repository settings. Other CI services offer similar federation; use it, and scope the role to the one signing key.
The public key can travel freely
Bootloader builds need the public key, not the private one. imgtool’s getpub command accepts “a public-key-only PEM” and “requires no private key material”, which the documentation notes “matters for production workflows where the signing private key is held only by a release team”. Commit the public key to the repository; keep the private key out of every repository and build directory.
Who can sign: approvals and records
Decide in writing which people may approve a production signature, require one of them for every release, and keep a record that links each signature to a person, a commit and an image. A signing key with a perfect HSM and no approval rule is only as safe as the CI system that can call it.
Approval rules that fit a small team
The update policy worksheet puts the rule in one line, for example: two named people may sign a production release, and the key stays in the signing service. For a team of three, a workable version is:
- Two people are named as release approvers, usually the CTO and the firmware lead.
- The person who tags the release cannot approve its signature.
- Emergency security releases follow the same rule, with a phone call replacing the usual review meeting.
Enforce it where you can
GitHub environments support required reviewers: up to six users or teams, one of whom must approve a job before it runs or reads the environment’s secrets. You can also “prevent self-reviews”, so the person who started a deployment cannot approve it. Check your plan first: GitHub’s documentation says that on Free, Pro and Team plans, required reviewers “are only available for public repositories”. A startup on a Team plan with a private firmware repository needs another gate, such as a key service policy that only allows the signing role after a separate approval step.
Records that answer the hard question
When something goes wrong, someone will ask: “Who signed the image running on unit 1042, and from what code?” Answer it with three linked records: the release record from step 6 above, the key service’s own log (CloudTrail on AWS), and the version string the device reports. The version scheme builder produces version strings that carry the build number and commit hash, so the device’s answer leads back to one commit.
When people leave
Access to a signing key is a list of people and roles, and the list changes. When an approver, or anyone who holds a token or its PIN, leaves the company:
- Remove their key service role and their CI approval rights the same day.
- Collect any hardware token they held. If a token cannot be accounted for, treat that key as exposed and plan a rotation.
- Rotate any CI or cloud credentials they could read.
Contractors should never hold the only copy of anything. The handover checklist includes “Signing keys and update server accounts owned by the client” and “Contractor access removed from every system after handover” as items to tick, not assumptions.
Check your chip’s key slots before the board is final
How many public keys a device can trust, and whether one can be retired, is fixed by the chip and bootloader you choose, not by your policy. Read your secure boot documentation for three numbers before the schematic is final: how many keys the device can trust, whether a key can be revoked, and whether the bootloader itself can ever be updated.
| Scheme | Where the trust anchor lives | Keys a device can trust | Retire a key in the field? | Decide before the first unit ships |
|---|---|---|---|---|
| ESP32, chip revision v3.0 or later, Secure Boot V2 | SHA-256 digest of one RSA-3072 public key in eFuse | One ("Only one public key can be generated and stored") | No second slot to move to | Key custody and a leak plan that assumes affected units cannot be re-keyed |
| ESP32-S3, Secure Boot V2 | Up to three public key digests in eFuse | Up to three | Yes: permanent revocation per key, conservatively or aggressively | Generate all keys, sign the bootloader with each, revoke unused slots at the factory |
| MCUboot, keys built into the bootloader | Public keys compiled into the bootloader image | One or more | Only by replacing the bootloader | Embed a reserve production key; protect the bootloader |
| MCUboot with MCUBOOT_HW_KEY | Public key hash provisioned on the device | Depends on how the device stores hashes | Depends on whether that storage can change | Where the hash lives, who can write it, and whether it can be locked |
Espressif ESP32 and ESP32-S3
On the original ESP32, Secure Boot V2 is available from chip revision v3.0, and Espressif’s guide states that “only one public key can be generated and stored in the chip during manufacturing” and only one signature block can be appended to an image. Every later bootloader or application must be signed with that key.
On the ESP32-S3, “up to three public keys can be generated and stored in the chip during manufacturing”, and the chip can “permanently revoke individual public keys”. Espressif’s key management advice: generate between one and three RSA-3072 key pairs “independently and stored separately”, write-protect the digest eFuses, and burn the revoke bit for every unused slot “before the device leaves the factory”. The bootloader “should be signed with all the private key(s) that are needed for the life of the device”, while applications are signed with one key at a time.
Unused slots matter because an empty slot is an invitation. If an attacker could write their own key digest into a spare slot, they would add a trust anchor of their own. That is why the guide revokes spare slots by default and warns that leaving them open “could pose a security risk”.
MCUboot
MCUboot’s design documentation says “the bootloader can have one or more public keys embedded in it at build time”. Zephyr’s current signing documentation (checked November 2026) accepts a comma-separated list of key files: “MCUboot embeds the public half of every key and accepts an image signed with any of them.”
The documented purpose of that list is a development bootloader that accepts both production and development images. The same mechanism lets a production bootloader trust a primary key and a reserve key. What it does not give you is revocation: a key compiled into the bootloader stays trusted until the bootloader is replaced. If your design never replaces the bootloader in the field, the keys it ships with are the keys it keeps.
MCUboot’s alternative, MCUBOOT_HW_KEY, keeps only a hash of the public key on the device and makes the bootloader “independent from the public key(s)”, which “can be provisioned any time and by different parties”. Whether you can later change that hash depends entirely on where your chip stores it and whether you lock it, so read your chip’s documentation before relying on it.
Choose an algorithm all three parts support
The key type must be supported by the bootloader, the chip and the signing service at once. imgtool’s documentation says “the key type used should match what MCUboot is configured to verify”. Espressif’s Secure Boot V2 on the ESP32 and ESP32-S3 uses RSA-3072. ECDSA P-256 appears in MCUboot’s list, in AWS KMS and in Google Cloud KMS, which makes it an easy match for MCUboot devices.
Test the whole chain before you commit. AWS documents two Ed25519 signing algorithms, one for raw messages and one for digests, and says the two message types “cannot be used interchangeably”; the bootloader expects exactly one form. A bench test with a real signed image settles it in an hour.
Look further ahead if your bootloader can never change. AWS now lists post-quantum ML-DSA key types, while imgtool’s list, as of November 2026, stops at RSA, ECDSA P-256 and Ed25519. RFC 9019 (April 2021) recommends that “unchangeable bootloader code in ROM” use “post-quantum secure signature schemes such as hash-based signatures”. For a product with a long service life, ask your chip vendor what its ROM can verify and whether a later key may use a different algorithm.
A delegation layer changes the picture
RFC 9124 recommends that signing keys “SHOULD be replaced from time to time” and, “because it is difficult and risky to replace a trust anchor”, that keys used for signing updates “SHOULD be delegates of that trust anchor”. In that design the device trusts a root key that signs rarely, and day-to-day signing keys are certified by it, so they can change without touching the device’s trust anchor.
The schemes in Figure 2 check images directly against the trusted key or its hash; the key that signs updates is the trust anchor. If you need delegation, it has to come from your update agent or a manifest format such as SUIT, and the field-updatable firmware overview explains where the update agent sits in the chain.
Rotation: changing keys on purpose
Rotate a firmware signing key when the plan says so, when a person with access leaves on bad terms, or when the algorithm or key size is due for retirement. On devices that trust a reserve key, rotation is a release; on devices that trust one key, it is a new hardware build.
Why rotate at all
NIST’s SP 800-57 Part 1 Rev. 5 (May 2020) defines a cryptoperiod as “the time span during which a specific key is authorized for use”, and the originator-usage period as the part of it during which the key may be used to apply protection, here meaning to sign. Every signing key should have both written down, even if the honest answer for a microcontroller product is “until the reserve key is needed”.
As of November 2026, Revision 6 of SP 800-57 Part 1 is an initial public draft, published December 5, 2025, with comments closed February 5, 2026. Its announced changes include the quantum-resistant algorithms of FIPS 203, 204 and 205. Rev. 5 remains the final version.
RFC 9124 adds a caution for time-based expiry: “If key expiration is performed based on time, then a secure clock is needed.” Many battery-powered devices have no clock they can trust after a reset, which is one reason to retire firmware keys with a signed event rather than by a date.
A planned rotation, step by step
On a device that trusts a primary and a reserve key:
- Prepare. Move the reserve key from its offline tokens into a signing service, or create a fresh service key and confirm its public key matches the one the devices already trust.
- Sign the next release with the new key. Test on bench units that the new signature is accepted and that the old key still works until the change is complete.
- Roll out in waves. Use the same staged waves as any release. Devices that are offline will catch up later.
- Retire the old key. Remove signing permission and schedule it for destruction only after you are sure no device needs an image signed with it. On chips with revocation, revoke it on the devices once they run the new image.
- Create the next reserve. A rotation consumes the reserve, so the next bootloader or hardware revision should embed a new one.
On the ESP32-S3, Espressif documents a “conservative approach” for exactly this: an over-the-air update signed with the new key boots, verifies the bootloader with the new key “as a final check”, and then revokes the old key’s eFuse with esp_ota_revoke_secure_boot_public_key().
Espressif also documents an aggressive mode, in which “the key is revoked as soon as verification with this key fails”. It reacts without waiting for a release, but the revocation is permanent, so enable it only after testing exactly what happens on your boards when a verification fails.
Revocation and recovery when a key leaks or is lost
A leaked key and a lost key are different emergencies. A leaked key means someone else may be able to sign firmware your devices accept; a lost key means you can no longer sign at all. Write both procedures before the first production release, because the first hours of either one are not the time to read documentation.
If the production key leaks
- Stop using it. Disable the signing role and preserve the key service logs for investigation.
- Find out what was signed. Compare the key service log with your release records. A signature with no matching release record is the evidence you were afraid of.
- Switch to the reserve key and ship a release signed with it, through your normal waves but faster.
- Revoke where the chip allows. On chips with revocation, the new image revokes the leaked key. On MCUboot with compiled keys, the leaked key stays trusted until the bootloader is replaced; say so in your risk assessment, and tighten other controls such as physical access to the update path.
- Assess and report. Decide whether customers or authorities must be told; for products under rules such as the EU Cyber Resilience Act, reporting duties may apply. Get legal advice on that question.
Devices that were offline during the change
Revocation reaches only the devices that receive the update. A unit in a warehouse or a customer’s drawer keeps trusting the old key until it next connects. When it does, it must still be able to install the newest image, and on a device that trusts both the old and the reserve key, it can. Three rules keep this from going wrong:
- Keep the newest image signed with the new key available for as long as any unit might come back online.
- Track which units have confirmed the change, so you can tell a customer exactly which units remain exposed.
- Re-flash units still in stock before they ship, rather than relying on their first connection.
If the production key is lost
Loss is quieter and can be just as final. If the only copy of a key that devices trust is deleted, the devices can never accept another update signed with it. A reserve key, stored separately and tested, turns a fatal loss into a rotation.
Test the reserve once a year: take a token out of the safe, sign a test image with it on the offline machine, and confirm a production unit on the bench accepts it. Record the test in the key policy.
Example (fictional). Bluestem Labs, a fictional startup, ships a Wi-Fi leak sensor on an original ESP32 with Secure Boot V2. The chip holds one public key digest. Eighteen months after launch, a contractor’s laptop turns out to have held a copy of the production key file. Bluestem can still update its sensors, and the attacker could too. No release can change the digest in the eFuses of the 3,000 units already installed, so the only full remedy is replacing hardware. The cheaper fix, a chip that holds three keys with revocation and a reserve key kept offline from day one, was a decision made before the first board was built.
Test that the keys are wired the way you think
Every key decision needs a test on a locked production unit, because a bootloader that silently accepts the development key looks exactly like one that refuses it until someone tries. Run the tests at the factory gate and again for every release candidate.
The secure boot checklist groups the tests under “Prove it”:
- An unsigned image is refused.
- An image signed with the development key is refused on a production unit.
- A downgrade to an older version is refused.
- Debug access is attempted on a locked unit and refused.
Add two tests for the key plan itself:
- Reserve key accepted. An image signed with the reserve key boots on a production unit. Without this test, the reserve might be wired wrong and you would find out during an incident.
- Revoked key refused. On chips with revocation, a unit that has revoked a key refuses images signed with it.
Downgrade refusal uses version or security counters, a separate mechanism from keys. Rollback versus anti-rollback explains how recovery and downgrade prevention fit together, so that a correctly signed but vulnerable old image cannot be reinstalled.
A one-page key policy for a startup
Write the key policy as one page that a new engineer can read in five minutes, and keep it in the firmware repository next to the release procedure. It should answer who, where, what and what if, and nothing more.
Example (fictional). The LW-1 key policy, as Loamwick might write it:
- Keys. Development (ECDSA P-256, file, bench boards only). Production primary (ECDSA P-256, cloud key service in Loamwick’s account, non-exportable). Production reserve (ECDSA P-256, two hardware tokens in two safes). Both production public keys are built into the MCUboot bootloader; the development key is not.
- Approval. The CTO or the firmware lead approves each production signature; the person who tags the release cannot approve it.
- Signing. CI exports the image digest, the key service signs it, CI inserts and verifies the signature. No private key on any laptop or runner.
- Records. Release record per signature: version, digest, key ID, approver, time, log reference. Key service logs kept for the life of the product.
- Deletion. Only the CEO’s account may schedule key deletion; scheduling triggers an alert to both founders.
- Leak. Disable the primary, compare logs with release records, ship the next release with the reserve key, and plan a bootloader update with a new reserve on Rev E.
- Loss. Promote the reserve, create a new reserve at the next hardware revision.
- Tests. Development-signed and unsigned images refused, reserve-signed image accepted, on a locked Rev D unit for every release candidate. Reserve token test every November.
What to do next
- List the keys you have today, including any copy of a production key on a laptop or in CI secrets, and move production signing into a key service or onto hardware tokens.
- Look up your chip’s key slots and revocation support before the board revision you will manufacture, and generate a reserve key now if the platform can trust it.
- Change your build so CI signs through the service, with an approval step your CI plan actually enforces.
- Write the one-page policy and run the tests above on a locked unit.
Fumbar’s firmware security work sets up signing in the client’s own account and writes the rotation and leak procedures with the team; our security page describes how we handle client keys during an engagement. If you want a second reader before your first production run, a firmware review covers the bootloader, the key plan and the update path and ends with a written list of risks and fixes.
