Skip to main content
1 of 2
Jens Erat
  • 1.4k
  • 11
  • 18

The OpenPGP message you posted is a signature, not a key. As it was issued by GnuPG, I assume you're using GnuPG anyway. To export your public key, run gpg --armor --export [key-id]. --armor wraps the output in a base64-like encoding (like the signature block you provided in your question), otherwise you'll get binary output. If you don't know your key-id, you can look it up through gpg --list-keys, possibly followed by a search pattern on a user ID you added -- for example your mail address.

The public key also contains user IDs, certifications, subkeys, ... and can be rather lengthy. The beginning of my own public key export:

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1

mQQNBFDaK/sBIADm2gjnw7aPoNIoCy7gj85btwZU+zGkvtGonznlLrXELdU6zR3u
VHNCn9vAl6OoU32r+suFvGdX+7MjiPbGKwJFOvICpAVh6bV55+hdqJbS02cpPmJH
1BrrUAmm6ZVEybGd+II1pTI6Mt/SAI1E/59VIBdC/1AwsxQtCTFeyaLqTdyd1FhQ
chkjcvdRHLb4cEqldAGqBL7SbiSNOP3p+vX8iwRN6PQ/erAGseawHnunuNIna+tA
t4te/MkI2uxT0KjsfF/NWHCB2aXt++egP8jGSaHRsVOlfHRVA3hHcUDlnW9DZRvG
QabHFcZvfcXAlNIRYKUzDIHEwpavAmHeGNhc2GNmDcDRF56741grVLNQT58vxK5o
dBLlC8ANckvE5ymdIKVPm+t5q10kFOAATcnmDV0oBt+15vzI3f+88yCoY904UWdY
[...]

If you want to dump the RSA primes, use the pgpdump tool (not included with GnuPG and has to be installed separately, but should be available readily packaged for all relevant distributions). To print the primes, you can directly pipe GnuPG's --export output into pgpdump (consider storing the output to a file or piping into less`, as the output can get really long):

gpg --export[key-id] | pgpdump -i

To understand the output of pgpdump (and the structure of OpenPGP messages), read RFC 4880.

Jens Erat
  • 1.4k
  • 11
  • 18