gpg print public key code example Example: How to export a GPG public key to a file gpg --output public.pgp --armor --export username@email