NervesKey.Config (nerves_key v1.3.0)

View Source

This is a high level interface to provisioning and using the NervesKey or any ATECC508A/608A that can be configured similarly.

Summary

Functions

Check if the chip's configuration is compatible with the NervesKey. This only checks what's important for the NervesKey.

Configure an ATECC508A or ATECC608A as a NervesKey.

Configure an ATECC508A or ATECC608A as a NervesKey with a volatile setup.

Check whether the ATECC508A has been configured or not.

Helper for getting information about the ATECC module.

Helper for getting the ATECC508A's serial number.

Prints configuration of device slots.

Functions

config()

config_compatible?(transport)

@spec config_compatible?(ATECC508A.Transport.t()) ::
  {:error, atom()} | {:ok, boolean()}

Check if the chip's configuration is compatible with the NervesKey. This only checks what's important for the NervesKey.

configure(transport, lock? \\ true)

Configure an ATECC508A or ATECC608A as a NervesKey.

This can only be called once. Subsequent calls will fail.

configure_volatile(transport, lock? \\ true)

Configure an ATECC508A or ATECC608A as a NervesKey with a volatile setup.

This can only be called once. Subsequent calls will fail.

configured?(transport)

@spec configured?(ATECC508A.Transport.t()) :: {:error, atom()} | {:ok, boolean()}

Check whether the ATECC508A has been configured or not.

If this returns {:ok, false}, then configure/1 can be called.

device_info(transport)

@spec device_info(ATECC508A.Transport.t()) :: {:error, atom()} | {:ok, map()}

Helper for getting information about the ATECC module.

device_sn(transport)

@spec device_sn(ATECC508A.Transport.t()) :: {:error, atom()} | {:ok, String.t()}

Helper for getting the ATECC508A's serial number.

set_encryption_key(info, key_id)

set_key_config(key_config, slot_id, key, value)

set_persistent_disable(info, key_id)

set_slot_config(slot_config, slot_id, key, value)

set_volatile_key(info, key_id)

volatile_config_compatible?(transport)