This blog post covers PGP signing support implemented in recent versions of SignServer
In a previous blog post, we addressed Code Signing of Windows binaries (Authenticode) and gave some background on why Code Signing is important for secure
software distribution.
We are now pleased to introduce code signing with PGP, commonly used for Open
Source software projects and packaging of software for Linux
environments in general.
OpenPGP Signing was first implemented in SignServer Enterprise 5.1 and will be available in SignServer Community 5.2, already available for download as a beta release.
SignServer Installation
To test the PGP support, download and install SignServer Enterprise 5.1 or SignServer Community
5.2.0.Beta1 or later.
For installation instructions, refer to SignServer Installation.
Setting up an OpenPGP Signer
When SignServer is up and running, access the SignServer Administration Web to
start setting up the workers.
Step 1: Set up Crypto Worker
If you don’t already have a crypto
worker configured, then set one up using, for example, the sample keystore:
-
Select the AdminWeb Workers tab, and click Add.
-
Click From Template, select keystore-crypto.properties in the list, and click Next.
-
In the configuration text view, change the value for WORKERGENID1.KEYSTOREPATH so that the path corresponds to your SignServer installation, for example: WORKERGENID1.KEYSTOREPATH=/home/username/signserver/res/test/dss10/dss10_keystore.p12.
-
Click Apply.
Remember the name of the crypto
worker (for example, CryptoTokenP12) as you will need it in the next step when setting up the OpenPGP Signer.
Step 2: Set up OpenPGP Signer
To set up the new OpenPGP signer, do the following:
- Select the SignServer AdminWeb Workers tab, and click Add to add a new worker.
- Choose the method From Template.
- Select openpgpsigner.properties in the Load from Template list and click Next.
- Change the sample
configuration properties as needed, for example:
-
Update the CRYPTOTOKEN property with the name of your crypto worker (for example, CryptoTokenP12).
-
Click Apply to load the configuration and list the worker in the All Workers list.
-
Select the added worker in the list to open the Worker page.
-
Check if the Worker status is Offline and if there are any errors listed. The "No key available for purpose" message means that the DEFAULTKEY property does not point to an existing key in the crypto token. In that case, either update the DEFAULTKEY property to point to an existing key or do the following to generate a new key to use with this signer:
-
Click Renew key and specify the following:
-
Set a Key Algorithm, for example "RSA".
-
Set a Key Specification, for example the key length "2048" (for RSA).
-
Update the New Key Alias to the name of DEFAULTKEY property (typically change to the same value as the Old Key Alias).
-
-
Click Generate.
-
Select the worker in the list and confirm that the Worker status is Active and without errors listed. If not, confirm that the DEFAULTKEY property is correct and check in the Crypto Token tab of the crypto worker that a key with the specified name exists.
Step 3: Add User ID to Public Key
Follow the steps below to add User ID /
Certification for the OpenPGP public key using the Generate CSR
option.
-
Select the AdminWeb Workers tab.
-
Select the OpenPGP worker and click Generate CSR.
-
Specify a Signature Algorithm, for example "SHA256withRSA"
-
Specify DN as the wanted User Id, for example "Markus (Code Signing) <markus@primekey.se>".
-
Click Generate, and then click Download.
-
Open the downloaded file using any text editor and copy its content.
-
Select the worker and click the Configuration tab.
-
For the PGPPUBLICKEY property, click Edit.
-
Paste the public key content in the Value field, and click Submit.
-
Click Status Summary and confirm that fields like PGP Key ID and PGP Public key are listed. Also, note that the User ID is listed.
Step 4: Sign
The following example shows how to
sign using the SignServer Public Web. You can test signing using any
of the SignServer client interfaces.
-
Click Client Web.
-
Under File Upload, specify the Worker name used, for example, OpenPGPSigner.
-
Select the file to create a detached signature for, for example, release.zip.
-
Click Submit and store the resulting signature file, for example, release.zip.asc.
Step 5: Verify Signature
The following
example shows how to verify the signature using the OpenPGP tool
GnuPG. It should be possible to use any OpenPGP tool to verify the
signature.
Run the
following to verify the signature using GnuPG:
$ gpg --verify release.zip.asc release.zip
If needed, first import the public key to GnuPG before verifying the signature in the third step:
-
Store the public key (i.e. from PGPPUBLICKEY property) as signer001-pub.asc.
-
Import the key to GnuPG:
$ gpg --import signer001-pub.asc
More Information
See also the OpenPGP Signer documentation and if you have any questions or comments don't hesitate to use our discussion forums.
Cheers,
the PrimeKey SignServer Team
the PrimeKey SignServer Team