GnuPG supports a command-line option --armor that that causes output to be generated in an ASCII-armored format similar to unencoded documents rather than the binary format. $ gpg --export -a KEY_ID $ gpg --export-secret-keys -a KEY_ID The ASCII-armored key format is similar to unencoded documents rather than the binary format. $ cat ~/.ssh/id_rsa.pub $ cat ~/.ssh/id_rsa