Skip to content

Latest commit

 

History

History
153 lines (128 loc) · 5.06 KB

File metadata and controls

153 lines (128 loc) · 5.06 KB

Git Verification

Git Verification Instructions

gpg --full-generate-key
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)
  (14) Existing key from card
Your selection? 4
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (3072) 4096
Requested keysize is 4096 bits        
      <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) 0
Key does not expire at all
Is this correct? (y/N) y

GnuPG needs to construct a user ID to identify your key.
Real name: <Your_Name>
Email address: <github_Email>
Comment: <My computer description>
You selected this USER-ID:
    "Your_Name (My computer description) <github_Email>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: AllowSetForegroundWindow(32500) failed: Access is denied.
gpg: ../trustdb.gpg: trustdb created
gpg: key XXXXXXXXXXXXX012 marked as ultimately trusted
gpg: directory '../gnupg/openpgp-revocs.d' created
gpg: revocation certificate stored as '../gnupg/openpgp-revocs.d\YYYYYYYYYYYYYYYYYYYYYYYYXXXXXXXXXXXXX012.rev'
public and secret key created and signed.

Note that this key cannot be used for encryption.  You may want to use
the command "--edit-key" to generate a subkey for this purpose.
pub   rsa4096/AAAAAAAAABBBBBBB 2021-09-22 [SC]
      YYYYYYYYYYYYYYYYYYYYYYYYXXXXXXXXXXXXX012
uid                      Your_Name (My computer description) <github_Email>

Configure git to use GPG

git config --global user.signingkey AAAAAAAAABBBBBBB

Git has it's own version (windows for now) of GPG so set it to use the correct version.

Windows

git config --global gpg.program "C:/Program Files (x86)/GnuPG/bin/gpg.exe"

Linux (WSL)

git config --global gpg.program gpg
gpg --list-secret-keys --keyid-format=long
gpg --armor --export YYYYYYYYY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XXXXXXXXXXXXXXXXXXXXXXXXXXXX
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
AAAAA
-----END PGP PUBLIC KEY BLOCK-----

Configure git commits to sign

git config --global commit.gpgsign true

Sign your git commit

git commit -S -m "your commit message"

WSL

Add the following to your shell: ~/.bashrc, ~/.zshrc, etc.

# Enable passphrase prompt for gpg - export GPG_TTY=$TTY - might be better on some systems.
export GPG_TTY=$(tty)
echo "GPG Login" | gpg --clearsign > /dev/null 2>&1

[Windows] GUI - Append the windows pinentry.exe to WSL via CLI

echo -e "# GPG4Win\npinentry-program \"/mnt/c/Program Files (x86)/gnupg/bin/pinentry-basic.exe\"\n\n# Newer version of Gpg4win\n# pinentry-program \"/mnt/c/Program Files (x86)/Gpg4win/bin/pinentry.exe\"" >> ~/.gnupg/gpg-agent.conf

Or

[~/.gnupg/gpg-agent.conf] - modify the file and add the following

# GPG4Win
pinentry-program "/mnt/c/Program Files (x86)/gnupg/bin/pinentry-basic.exe"

# Newer version of Gpg4win
# pinentry-program "/mnt/c/Program Files (x86)/Gpg4win/bin/pinentry.exe"