Pre-requisite
- Gpg4win (i.e from https://www.gpg4win.org/).
 
Generating Keys
- 
- Run the following command:
gpg --full-gen-key
 - Type 1 and press enter for the following question:
Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection?
 - Press enter for the following question:
RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048)
 - Press enter for the following question:
Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) - Type y and press enter for the following question:
Key does not expire at all Is this correct? (y/N)
 - Fill in the Real name appropriately and press enter.
 - Fill in the Email address appropriately and press enter.
 - The Comment is optional but don't forget to press enter.
 - Type o and press enter for the following question:
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?
 - Fill-in the passphrase appropriately.
 
 - Run the following command:
 
The output will be ending with something like the following:
pub   rsa2048 2019-11-27 [SC]
      8C99E30527B112D1CB6D646FE86A4FE7189AADC9
uid                      Real Name <real_email@email.com>
sub   rsa2048 2019-11-27 [E]
The second line is the PGP key ID. Thus from the output above. The key id is:
8C99E30527B112D1CB6D646FE86A4FE7189AADC9
Exporting Your Private Key
The my-secret-key.pgp file generated by this command can be use for signing your binaries.
Run the following command:
gpg --export-secret-keys <KEY_ID> > my-secret-key.pgp
DO NOT SHARE THIS FILE OR COMMIT TO YOUR REPOSITORY.
Publishing Your Public Key
Run the following command:
gpg --keyserver hkp://keys.openpgp.org --send-keys <KEY_ID>
Validating your Published Public Key
- You can validate the upload public key by placing your <KEY_ID> as a Search String from the following address: https://keys.openpgp.org.
This will only work if you submit your keys using the preceding section.
 - Click the Search button.
 
Leave a Reply