Updated on 2024-11-22 GMT+08:00

Configuring a GPG Public Key

Perform the following steps to generate and configure a GPG public key in CodeArts Repo:

  1. Download the GPG key generation tool from gpg4win official site.
  2. Run the gpg --full-generate-key command on the local Git client, select the encryption algorithm, key length, expiration time, and correctness in sequence as prompted, and enter a username, email address, and comment, as shown in Figure 1.

    Figure 1 Generating a GPG Key Pair

  3. After confirming that the information is correct, type O and press Enter as prompted. In the displayed dialog box for entering and confirming the password, enter the correct password to generate a key.

    If the information shown in Figure 2 is displayed, the GPG key is generated successfully.

    Figure 2 Successful generation of a GPG key

  4. Run the gpg --armor --export command to export the public key, as shown in Figure 4 Exporting the GPG public key, and copy the public key to the clipboard, including -----BEGIN PGP PUBLIC KEY BLOCK----- and -----END PGP PUBLIC KEY BLOCK-----.

    Figure 3 Exporting the GPG public key

  5. Log in to the repository list page of CodeArts Repo, click the alias in the upper right corner, and choose This Account Settings > Repo > GPG Public Keys.
  6. Click New GPG Public Key. On the page that is displayed, set the following parameters.

    Table 1 Parameters for creating a GPG public key

    Parameter

    Description

    Title

    Mandatory Custom GPG public key name with a maximum of 200 characters.

    GPG Public Keys

    Mandatory Paste the GPG public key copied from 4 to this text box.

    Description

    Optional. Enter a maximum of 200 characters. If the description is empty, -- will be displayed in the list.

  7. Click OK. The GPG public key is created successfully and the GPG public key list page is displayed.

    • A GPG public key cannot be used repeatedly. If you fail to add a GPG public key, check whether you have added the public key and whether there are redundant spaces before and after the public key.
    • After the public key is added successfully, you can view the added public key on the GPG Public Keys page. If the public key is no longer used, you can delete it.