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