View Source NervesKey.Data (nerves_key v1.2.0)

This module handles Data Zone data stored in the NervesKey.

Link to this section Summary

Functions

Clear out the auxillary slots

Return the slot that stores the compressed device certificate.

Create a public/private key pair

Run the genkey operation on the NervesKey private key slot

Return the slot that stores the compressed signer certificate.

Return the slot that stores the signer's public key.

Determine what's in all of the data slots

Write new device and signer certificates to the auxillary slots

Write all of the slots

Link to this section Functions

Link to this function

clear_aux_certs(transport)

View Source
@spec clear_aux_certs(ATECC508A.Transport.t()) :: :ok

Clear out the auxillary slots

@spec device_cert_slot(NervesKey.certificate_pair()) :: ATECC508A.Request.slot()

Return the slot that stores the compressed device certificate.

Link to this function

genkey(transport, create? \\ true)

View Source
@spec genkey(ATECC508A.Transport.t(), boolean()) ::
  {:ok, X509.PublicKey.t()} | {:error, atom()}

Create a public/private key pair

The public key is returned on success. This can only be called on devices that have their configuration locked, but not their data.

Link to this function

genkey_raw(transport, create?)

View Source
@spec genkey_raw(ATECC508A.Transport.t(), boolean()) ::
  {:ok, ATECC508A.ecc_public_key()} | {:error, atom()}

Run the genkey operation on the NervesKey private key slot

Link to this function

lock(transport, otp_data, slot_data)

View Source
@spec lock(ATECC508A.Transport.t(), binary(), [{ATECC508A.Request.slot(), binary()}]) ::
  :ok | {:error, atom()}
@spec signer_cert_slot(NervesKey.certificate_pair()) :: ATECC508A.Request.slot()

Return the slot that stores the compressed signer certificate.

Link to this function

signer_pubkey_slot(atom)

View Source
@spec signer_pubkey_slot(NervesKey.certificate_pair()) :: ATECC508A.Request.slot()

Return the slot that stores the signer's public key.

Link to this function

slot_data(device_sn, device_cert, signer_cert)

View Source

Determine what's in all of the data slots

Link to this function

write_aux_certs(transport, device_sn, device_cert, signer_cert)

View Source

Write new device and signer certificates to the auxillary slots

Link to this function

write_slots(transport, slot_data)

View Source
@spec write_slots(ATECC508A.Transport.t(), [{ATECC508A.Request.slot(), binary()}]) ::
  :ok

Write all of the slots