nerves_key v0.3.0 NervesKey.Data View Source
This module handles Data Zone data stored in the NervesKey.
Link to this section Summary
Functions
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
device_cert_slot(atom)
View Source
device_cert_slot(NervesKey.certificate_pair()) :: ATECC508A.Request.slot()
device_cert_slot(NervesKey.certificate_pair()) :: ATECC508A.Request.slot()
Return the slot that stores the compressed device certificate.
genkey(transport, create? \\ true)
View Source
genkey(ATECC508A.Transport.t(), boolean()) ::
{:ok, X509.PublicKey.t()} | {:error, atom()}
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.
genkey_raw(transport, create?)
View Source
genkey_raw(ATECC508A.Transport.t(), boolean()) ::
{:ok, ATECC508A.ecc_public_key()} | {:error, atom()}
genkey_raw(ATECC508A.Transport.t(), boolean()) :: {:ok, ATECC508A.ecc_public_key()} | {:error, atom()}
Run the genkey operation on the NervesKey private key slot
lock(transport, otp_data, slot_data)
View Source
lock(ATECC508A.Transport.t(), binary(), [{ATECC508A.Request.slot(), binary()}]) ::
:ok | {:error, atom()}
lock(ATECC508A.Transport.t(), binary(), [{ATECC508A.Request.slot(), binary()}]) :: :ok | {:error, atom()}
signer_cert_slot(atom)
View Source
signer_cert_slot(NervesKey.certificate_pair()) :: ATECC508A.Request.slot()
signer_cert_slot(NervesKey.certificate_pair()) :: ATECC508A.Request.slot()
Return the slot that stores the compressed signer certificate.
signer_pubkey_slot(atom)
View Source
signer_pubkey_slot(NervesKey.certificate_pair()) :: ATECC508A.Request.slot()
signer_pubkey_slot(NervesKey.certificate_pair()) :: ATECC508A.Request.slot()
Return the slot that stores the signer's public key.
slot_data(device_sn, device_cert, signer_cert)
View Source
slot_data(ATECC508A.serial_number(), X509.Certificate.t(), X509.Certificate.t()) ::
[{ATECC508A.Request.slot(), binary()}]
slot_data(ATECC508A.serial_number(), X509.Certificate.t(), X509.Certificate.t()) :: [{ATECC508A.Request.slot(), binary()}]
Determine what's in all of the data slots
write_aux_certs(transport, device_sn, device_cert, signer_cert)
View Source
write_aux_certs(
ATECC508A.Transport.t(),
ATECC508A.serial_number(),
X509.Certificate.t(),
X509.Certificate.t()
) :: :ok
write_aux_certs( ATECC508A.Transport.t(), ATECC508A.serial_number(), X509.Certificate.t(), X509.Certificate.t() ) :: :ok
Write new device and signer certificates to the auxillary slots
write_slots(transport, slot_data)
View Source
write_slots(ATECC508A.Transport.t(), [{ATECC508A.Request.slot(), binary()}]) ::
:ok | {:error, atom()}
write_slots(ATECC508A.Transport.t(), [{ATECC508A.Request.slot(), binary()}]) :: :ok | {:error, atom()}
Write all of the slots