DISTRIBUTION: Generate and Upload Signing Keys for RLM

Products
JFrog_Distribution
Content Type
User_Guide
AuthorFullName__c
Raphael Zaafrani
articleNumber
000006549
FirstPublishedDate
2025-09-02T11:56:32Z
lastModifiedDate
2025-09-02

DISTRIBUTION: Generate and Upload Signing Keys for RLM

Introduction 

Once you are ready to release your software, signing your release is a crucial step to ensuring customer security. To that end, JFrog RLM allows you to sign your release bundles with ease. In this guide, we will review the steps needed to upload your signing keys to your JFrog platform.


Generating the Key

In this guide, we will generate the key on Linux using GPG. To follow this, you will need to use GPG version 2.1 or higher.

First, we will use the following command:
gpg --full-generate-key
For which you will be prompted with the following:
# Please select what kind of key you want:
# >  Select "(1) RSA and RSA" by entering "1".

# RSA keys may be between 1024 and 4096 bits long.
# What keysize do you want? (3072)
The Key needs to be at least 2000 bits long, so we will use 2048.
# >  Enter "2048"

# Please specify how long the key should be valid.
Here, we enter 0 to disable expiration on our key, but you can set your expiration as needed.
# >  Enter "0"

# Is this correct? (y/N)
# >  Enter "y"

# GnuPG needs to construct a user ID to identify your key.
#
# Real name:
# >  Enter "{your-key-id}"
#
# Email address:
# >  Enter "{your-email}"
#
# Comment:
# >  Enter "{your-comment}"
#
# Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?
# >  Enter "o"
After this step, you will be prompted to enter a passphrase for the keys.

Once we've entered the passphrase on the last step, we'll have successfully generated a key. 

The workflow will look like this:

User-added image 

To retrieve the keys, we will need the key ID (output under "pub", "F2435D635940935235C116F4417B5D33533BC61C" in the above) and the following commands:
# Export the private key with the specified id to a file
gpg --output {private key file name and path} --armor --export-secret-keys {key-id}  

# Export the public key with the specified id to a file
gpg --output {public key file name and path} --armor --export {key-id}
If you do not remember your key ID you can find it once more by running "gpg -k" which will list all your keys.

Once you have your keys in hand, you can upload them either through the UI or API:


Using the Artifactory UI:

Under Administration → Security → Keys Management:

User-added image 

Under Signing Keys → Add Keys → GPG Keys:

User-added image 

And fill the pop-up window:

User-added image 

Finally, propagate your key to your edge nodes using the API:
curl -X POST -u"CREDENTIALS" "INSTANCE_URL/lifecycle/api/v2/distribution/key/propagate/KEY_NAME"
Now you are ready to sign your releases!


Using the API:

When using the API, you can upload and propagate your key all in one step using the following API call. You will need a JSON file formatted as follows:
{
    "key": {
    "alias" : "KEY NAME",
    "public_key": "-----BEGIN PGP PUBLIC KEY BLOCK-----

XXXPUBLIC KEY HEREXXXXX
-----END PGP PUBLIC KEY BLOCK-----
",
    "private_key": "-----BEGIN PGP PRIVATE KEY BLOCK-----

XXXPRIVATE KEY HEREXXXXX
-----END PGP PRIVATE KEY BLOCK-----
"
   },
   "propagate_to_edge_nodes": true,

   "fail_on_propagation_failure": false,

   "set_as_default": true
}
And the request will look as follows:
curl \                                                                                                                                                                                                                 
    -s \
    -u"USERNAME" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -X POST \
    "ARTIFACTORY_URL/distribution/api/v1/keys/gpg" \
    -T JSON_FILE-NAME.json