Updated on 2022-03-13 GMT+08:00

Configuring the OpenPGP Public Key

Prerequisites

  • The public key is configured by the DDK installation user.
  • The GnuPG tool is installed on Linux.

    Verification:

    • If the GnuPG tool has been installed, run the gpg --version command in the shell. Information in Figure 1 is displayed:
      Figure 1 Command output
    • If the GnuPG tool is not installed, install the tool by following the instructions provided in its official website https://www.gnupg.org/.

Configuring a Public Key

  1. Obtain the public key file.

    Go to the OpenPGP download page and click the download link, as shown in Figure 2. The file download page is displayed.

    Figure 2 Click to download the file.

    The KEYS file is the public key file, as shown in Figure 3.

    Figure 3 Selecting the KEYS file

    If you want to switch to the English interface, click in the upper right corner.

  2. Upload the downloaded KEYS.txt file to the Linux OS where the DDK is located,

    for example, /home/username/openpgp/keys.

  3. Import the public key file.

    Run the following command to go to the directory that contains the public key file KEYS.

    gpg --import "/home/username/openpgp/keys/KEYS.txt"
    Figure 4 Import the public key file.

    /home/username/openpgp/keys indicates the absolute path of the public key file KEYS. username must be replaced with the name of the DDK installation user.

  4. Run the following command to view the import result:

    gpg --fingerprint
    Figure 5 Checking the import result

  5. Verify the public key.

    • The validity of the OpenPGP public key must be verified based on the public key ID, fingerprint, UID, and the publisher of the public key. The published information of the OpenPGP public key is as follows:
      • Public key ID: 27A74824
      • Key fingerprint: B100 0AC3 8C41 525A 19BD C087 99AD 81DF 27A7 4824
      • UID: OpenPGP signature key for Huawei software (created on 30th Dec, 2013) <support@huawei.com>

      After the information is verified, you can set the trust level for the public key

    • by running the following command:
      gpg --edit-key "OpenPGP signature key for Huawei software" trust

      Information similar to the following is displayed. Enter 5 after Your decision?, which indicates I trust ultimately. Enter y after Do you really want to set this key to ultimate trust? (y/N).

      Figure 6 Setting the trust level for the public key

  1. Run the quit command to exit.