fwup on the device before anything is written. A device refuses firmware it cannot verify.
This page covers fwup firmware and archives. ESP-IDF and RAUC use different key types, described in ESP-IDF and RAUC.
Where the signature is checked
Only the private key can sign. Keep it out of source control, and out of the firmware.
Create and register a key
Signing keys belong to an organization. Every product in the organization shares them.- nh key create
- fwup -g
~/.nh/keys/<org>/ as my_app_key.priv and my_app_key.pub. The private key file is encrypted at rest, with an optional passphrase.nh key list prints each Ed25519 public key in full. That value is what goes into fwup_public_keys.
Give devices the public keys
A device needs at least one public key before it accepts an update.Put the keys in the firmware
List the base64 public keys in your firmware config:nerves_hub_link 2.14.0 it also ignores any keys NervesHub sends without being asked. Verification then depends only on what you built into the firmware. Changing the list means shipping new firmware, signed by a key the running firmware already trusts.
Ask NervesHub for the keys
A device with nofwup_public_keys asks NervesHub for keys each time it connects. NervesHub replies with all of the organization’s Ed25519 public keys. This needs nerves_hub_link 2.2.1 or later.
To request keys even when some are configured, set request_fwup_public_keys:
Unverifiable firmware is refused
Sincenerves_hub_link 2.13.0, a device with no usable public key refuses the update. fwup only checks a signature when it is given a key, so earlier versions applied the firmware unverified.
The refusal happens before update_available/1 is called, so your Client is not asked. The device logs:
Refusing unverified firmware : no public keys available.
Two related changes tighten how keys from the server are handled:
When a signature does not match any key the device holds,
fwup fails and the update is reported as failed. See failed updates.
Sign firmware
nh firmware upload signs before it uploads:
--skip-signing. NervesHub still verifies the signature.
To sign without uploading, use fwup directly:
Use more than one key
- Separate development and production. Sign release builds with a production key held only by your release pipeline. Build production firmware with only the production public key in
fwup_public_keys. Development-signed firmware then cannot be installed on production devices. - Rotate a key. Ship firmware that lists both the old and the new public key, signed with the old key. Once devices run it, sign later firmware with the new key. Remove the old public key from the list in a later release.
fwup_public_keys only affects devices that receive the firmware built without it.
Archive keys
Archives are verified the same way, with their own key list. See Archives forarchive_public_keys and request_archive_public_keys.

