singpolyma / openpgp-php

OpenPGP.php is a pure-PHP implementation of the OpenPGP Message Format (RFC 4880).
http://singpolyma.github.io/openpgp-php/
The Unlicense
180 stars 70 forks source link

Generate keys ASCII #77

Closed dev3inv closed 3 years ago

dev3inv commented 5 years ago

I followed the instructions in the example of keygen and at the time of printing the keys (the print's shown in the example), they appear in a format of characters that do not correspond to ASCII, and I would like to know if any conversion should be done to pass it to ASCII or if those are not keys and they are obtained in another way.

Thank you.

singpolyma commented 5 years ago

Yes, if you want ASCII armor instead of normal OpenPGP format, then use OpenPGP::enarmor to convert bytes to the armor format.

For a key that would look something like: OpenPGP::enarmor($pubm->to_bytes(), 'PGP PUBLIC KEY BLOCK')