Examples: Zephyr
Provisioning Certificates sample
The certificate_provisioning
sample
is one example of how to provision credentials on devices. It illustrates how to
store device certificates on non-volatile flash memory. This way, each device
has its own unique certificates, and future firmware updates will not overwrite
these stored credentials.
The certificate_rotation
sample
starts from certificates provisioned the same way and then uses Golioth PKI to
request a new certificate from Golioth.
The following steps are covered in the code example:
- Generate a set of root and device certificates using the Golioth Docs as a guide.
- Compile and flash the firmware example onto the device.
- Use
mcumgrto copy the device certificate and key (DER) to/lfs1/credentials/crt.derand/lfs1/credentials/key.deron the device filesystem. - Upload the root certificate to Golioth.
The project-id for your Golioth project is supplied as part of the device credentials creation. This will be matched with any root certificates uploaded to that project in order to authenticate.
If this is the first time the device has connected to Golioth, a new device entry is automatically added to your Golioth project. There is no need for Golioth to have advanced knowledge about your newly manufactured devices (beyond having a copy of the public root certificate).