Skip to main content
NervesKey stores a device’s certificate and private key in a secure element on the I2C bus. NervesHubLink reads the certificate from the chip and uses the chip’s key for the TLS handshake, so the private key is not stored on the filesystem. NervesHub sees an ordinary device certificate. Everything in Device certificates about registering the CA and adding devices applies.

Requirements

  • A provisioned NervesKey on the device. Provisioning writes the device certificate and the signer certificate to the chip. It is done with the nerves_key library, not with NervesHub. Follow the nerves_key documentation.
  • The nerves_key library in your firmware. nerves_hub_link accepts nerves_key 0.5 and 1.x as an optional dependency.
  • The signer certificate registered with your organization as a certificate authority.

Enable it

1

Add the dependency

2

Configure the host

When nerves_key is in the project and you have not set configurator, NervesHubLink uses NervesHubLink.Configurator.NervesKey. It takes priority over the TPM and shared secret configurators.
3

Register the signer certificate

Register the certificate that signed the device certificates as a certificate authority. See Register a certificate authority. Registration needs the signer’s private key, to prove you own it.
4

Make the devices known to NervesHub

Choose one:
  • Add each device before it connects, with the identifier in its certificate’s common name. See Devices.
  • Give the certificate authority a just-in-time provisioning profile, so devices are created on first connection. See Just-in-time provisioning.
  • If you have a Microchip Trust&Go manifest for your secure elements, import it with nh device import. It creates each device with the certificate in its manifest entry.

What the configurator does

At startup the configurator opens the I2C bus and fills in the ssl options that you have not already set:

Options

Set these under the :nerves_key key:
integer
default:"1"
The I2C bus number the chip is on. 1 means i2c-1.
atom
default:":primary"
Which certificate pair to read from the chip, :primary or :aux. The primary pair can be written once. The auxiliary pair can be updated.

Check that it works

Boot the device and open its Settings tab in NervesHub. The Certificates card lists the certificate from the chip and the CA that signed it.