Prepare GPG Key

If the build environment is 5.0 or above, the Package Toolkit will use a gpg key to sign the package when creating the spk file.
Please refer to Package Signature for more details about package signatures.

If you have your own GPG key (without a passphrase) already, you will need to put the private key in /root/.gnupg under each platform (/toolkit/build_env/ds.${platform}-6.0/root/.gnupg/).

Generate the GPG key

Requirement: gpg, gpg-agent

gpg --gen-key

> Please select what kind of key you want:
   (1) RSA and RSA (default)
> choose key size and enter your name, email
> enter a passphrase: just press Enter without typing any character

WARNING: Please make sure that you do not type any characters in the passphrase field, otherwise the build process will FAIL.

After completing the steps above, the key will be generated under ~/.gnupg. Move them with the chroot environment.

cp ~/.gnupg/* /toolkit/build_env/ds.${platform}-6.0/root/.gnupg/

You can also use the following commands to verify whether the key was successfully imported or not.

cd /toolkit/build_env/ds.${platform}-6.0/
chroot .
gpg -K

The output may produce the following message.

sec   2048R/145E0AFD 2015-12-21
uid                  Synology Inc. <>
ssb   2048R/E0C20F11 2015-12-21