GPG/PGP Stuff

GPG / PGP References, commands or other stuff

documentation

This document goes ofer GPG / PGP references, commands or other things

GPG Basics

Git use key

git config --global user.signingkey <SIGNING KEY>
git config --global commit.gpgsign true

GPG export and upload to openpgp.org

gpg --armor --export C74E35FA85C2108306D766288F49C170420FADED | curl -T - https://keys.openpgp.org
GPG export only mail signing key
gpg --list-secret-keys --keyid-format long
gpg --armor --export-secret-subkeys 2A766613CAB05FA9

GPG import non-signed key

gpg --allow-non-selfsigned-uid --import private.pgp

GPG make existing key a subkey of new key

gpg --with-keygrip --list-secret-keys
gpg --expert --edit-key NEWKEYID
# then addkey from the keygrip

GIT use subkey specifically

gpg --list-secret-keys --keyid-format LONG
# Look for ssb line that can [S] (sign)
git config --global user.signingkey "9347FAB6E8CFC7D5!" # add !

GPG SSH

echo "enable-ssh-support" >> ~/.gnupg/gpg-agent.conf
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) # May want to add this to your .bashrc
echo "KEY ID" >> .gnupg/sshcontrol

# Make sure you have a key with the Authentication ability
gpg --export-ssh-key <KEY ID> > ~/.ssh/id_gpg_ssh.pub

# Then actually copy the pubkey over
ssh-copy-id -f -i ./.ssh/id_gpg_ssh.pub <host>