Provisioning with CLI

This page describes the available methods for provisioning Aliro credentials on the door lock device using the command-line interface. Once you have Set up the Aliro Test Harness, complete the following steps:

  1. Generate a Reader key pair:

    cd scripts
    python3 generate_keypair.py --verbose
    

    Save both values:

    • READER_PRIV - Reader private signing key (32 bytes, hex).

    • READER_PUB - Reader public key (65 bytes, hex).

  2. Set the dut_reader_public_key field in the Test Harness project configuration to READER_PUB.

  3. Provision the Reader private signing key (READER_PRIV) in the DUT using the following reader shell command:

    uart:~$ reader private_key set <32-byte private key in hex without 0x>
    

    Note

    Once the required credentials are provisioned (Reader identifier and Reader private signing key), the device will automatically start the Aliro stack.

  4. Install the Reader identifier in the Reader device.

    Install the complete 32-byte Reader identifier using a single command.

    reader identifier <32-byte_reader_identifier_in_hex_without_0x>
    

    Example:

    reader identifier 00113344667799AA00113344667799AA113344667799AA00113344667799AA00
    
  5. Set the th_access_credential_public_key in the DUT using the following dl provisioning shell command:

    uart:~$ dl provisioning AC_key set <key id> <65-byte public key in hex without 0x>
    

    For example:

    uart:~$ dl provisioning AC_key set 0 04742df736d0fc9be978c45b00e8fdf7cea684ea105ae574c1505a2c24ab6198e3125b7f1b7e1d134c55ece69681ba8ecc18a3836dc5199c759f31e8ccf17e3efa
    

    Note

    You can also use the following commands:

    • uart:~$ dl provisioning AC_key clear <key id> - This command clears the public key stored in the DUT by its ID (for example, uart:~$ dl provisioning AC_key clear 0).

    • uart:~$ dl provisioning AC_key clear all - This command clears all public keys stored in the DUT.

    • uart:~$ dl provisioning AC_key list - This command lists all public keys stored in the DUT.

    For example:

    uart:~$ dl provisioning AC_key list
    [0]: 04742df736d0fc9be978c45b00e8fdf7cea684ea105ae574c1505a2c24ab6198e3125b7f1b7e1d134c55ece69681ba8ecc18a3836dc5199c759f31e8ccf17e3efb
    [1]: (null)
    [2]: (null)
    [3]: (null)
    [4]: (null)
    [5]: (null)
    [6]: (null)
    [7]: (null)
    [8]: (null)
    [9]: (null)
    
  6. Optionally, set the dut_credential_issuer_public_key in the DUT using the following dl provisioning shell command:

    uart:~$ dl provisioning CI_key set <key id> <65-byte public key in hex without 0x>
    

    For example:

    uart:~$ dl provisioning CI_key set 0 047BA31938492E3F5E97BC91806B5835B5D9E426609139006711E5FB7A670EE4E12FC9F25396C013CC20166029D761A105DEA5E071E84A9E499920524CE2301137
    

    Note

    You can also use the following commands:

    • uart:~$ dl provisioning CI_key clear <key id> - This command clears the public key stored in the DUT by its ID (for example, uart:~$ dl provisioning CI_key clear 0).

    • uart:~$ dl provisioning CI_key clear all - This command clears all public keys stored in the DUT.

    • uart:~$ dl provisioning CI_key list - This command lists all public keys stored in the DUT.

    For example:

    uart:~$ dl provisioning CI_key list
    [0]: 047BA31938492E3F5E97BC91806B5835B5D9E426609139006711E5FB7A670EE4E12FC9F25396C013CC20166029D761A105DEA5E071E84A9E499920524CE2301137
    
  7. Optionally, set the Credential Issuer Certificate Authority (CA) public key in the DUT using the following dl provisioning shell command:

    uart:~$ dl provisioning CI_CA_key set <65-byte public key in hex without 0x>
    

    For example:

    uart:~$ dl provisioning CI_CA_key set 047BA31938492E3F5E97BC91806B5835B5D9E426609139006711E5FB7A670EE4E12FC9F25396C013CC20166029D761A105DEA5E071E84A9E499920524CE2301137
    

    Note

    You can also use the following commands:

    • uart:~$ dl provisioning CI_CA_key list - This command retrieves the Credential Issuer CA public key stored in the DUT.

    • uart:~$ dl provisioning CI_CA_key clear - This command clears the Credential Issuer CA public key stored in the DUT.

    For example:

    uart:~$ dl provisioning CI_CA_key list
    047BA31938492E3F5E97BC91806B5835B5D9E426609139006711E5FB7A670EE4E12FC9F25396C013CC20166029D761A105DEA5E071E84A9E499920524CE2301137