Skip to content

Generate gpg key

veeramarni edited this page Oct 30, 2019 · 3 revisions

Generating a gpg key to add in repos for decrypting secret files

1- install gpg
2- install git-crypt
3- generate you gpg key and add <YOUR_NAME> and <YOUR_EMAIL> when you are prompt for name and email gpg --gen-key
4- gpg --export -a <YOUR_NAME> > public.key
5- share the public key with the repo admin to add

Note for repo admin to add someone's key to a repo you must be able to decrypt it (your key on it) Follow the link to add user key. https://github.com/cdmbase/knowledge-base/wiki/Encrypting-secret-files-and-use-in-jenkins#adding-user-key-to-a-repo

6- Start decrypting by running the git-crypt command in the repo

$ git clone <REPO>
$ cd <REPO>
$ git-crypt unlock
$ cat <ANY_SECRET_FILE>
Clone this wiki locally