Skip to main content

Generate local (insecure) root key and certificate

The version 3 (v3 and v3_attest) extensions define the certificate format and establish the Certificate Authority (CA). This process allows you to create a local CA with specific attributes and constraints set by the v3 extensions, allowing you to issue certificates for testing and development purposes. Follow these steps to generate a local root key and certificate.
  1. Create an opensslroot.cfg using the following sample OpenSSL configuration file: OpenSSL is an open-source toolkit for secure sockets layer (SSL) and transport layer security (TLS) protocols, offering cryptographic functions and a command-line tool. The following sample OpenSSL configuration file is used for generating certificate requests and managing a Certificate Authority (CA).
    Note While running any OpenSSL commands on Windows platform, if you get error such as:
    • Can’t load /home/slua_xxxx/.rnd into RNG.
      xxxx:error:xxxx:random number generator:RAND_load_file:Can’t open file:crypto/rand/randfile.c:98:Filename=/home/slua_xxxx/.rnd
    • Can’t write random bytes.
    xxxx:error:xxxx:random number generator:RAND_write_file:Can’t open file:crypto/rand/randfile.c:233:Filename=/home/slua_xxxx/.rnd
    Commment out the following line from the opensslroot.cfg file:
    RANDFILE = $ENV::HOME/.rnd
  2. To create the v3.ext and v3_attest.ext extensions, use the following:
  3. Prepare the environment, create a directory named OEM-KEYS to generate all certificates and keys at one location.
    • For Linux, use the following commands:
    • For Windows, copy opensslroot.cfg, v3.ext, and v3_attest.ext to the OEM-KEYS directory.
The table lists the supported cryptographic algorithms. Table : Cryptographic algorithms The table lists the supported configuration by cryptographic algorithms. Table : Configurations for cryptographic algorithms Note The PK HASH used for fusing in QFPROM region is SHA-384 for all configurations, irrespective of the signature algorithm used.

Generate a key pair for secure boot

Select one of the supported algorithms to enable secure boot on the device using either ECDSA or RSA.
For support cryptographic algorithms see the Cryptographic algorithms table. Note ECDSA is recommended over RSA for better security, if supported.

Option 1: Generate ECDSA root key and certificate

ECDSA offers superior security and performance compared to the RSA signature algorithm. As a result, the default configuration in SecTools supports ECDSA signing. The following types of keys are created with ECDSA: - The public key, which is accessible to everyone. - The private key, which is only known to the owner of the key pair. You can modify and run the following ECDSA-specific commands to generate the root key and certificate:
  1. Go to the OEM-KEYS directory and generate the ECDSA root key and certificate:
  2. Generate the intermediate Certificate Authority (CA) key pair and certificate:

Option 2: Generate RSA key pair and certificate

The RSA signature algorithm uses asymmetric keys (public/private) to verify message authenticity and integrity. A private key and a public key are created with RSA:
  • The public key is accessible to anyone.
  • The private key is only known to the owner of the key pair.
An image is signed with the RSA private key chain and verified with the OEM public key or certificate chain (Anchored in fuses). Follow these steps to generate RSA Key pair and certificates.
  1. To generate the root client application key pair and certificate, run the following commands: The key size used is 2048. However, a key size of 4096 is also supported.
  2. To generate the attestation client application key pair and certificate, run the following commands using RSA with a key size of 2048:
    Note For OpenSSL > 3.x, don’t pass the -sigopt digest:sha256 option.

Generate SHA-384 hash for RSA and ECDSA

The SHA-384 hash is crucial in cryptographic applications for several reasons, including enhancing security strength, creating digital signatures, ensuring compliance with standards, and future-proofing. SHA-384 will be used as the RoT and ensure the authenticity and integrity of software images To generate the SHA-384 hash of the root certificate, run the following command:

Next steps

  • To ensure the authenticity and integrity of software images and to write a complete software image, see Sign and flash the images.
  • To ensure device security by allowing only digitally signed images to be programmed, see Perform VIP flashing.