Generate PEM or CER file from the text of a public key

14.1k Views Asked by At

I have a public key given in a document, in the form

-----BEGIN CERTIFICATE----- blah blah blah -----END CERTIFICATE-----

Is there a tool I can use to generate a PEM or CER file from this? I've looked into openssl, and googled around until I think I'll go crazy. It seems most people don't get the key in raw text format.

1

There are 1 best solutions below

6
On BEST ANSWER

It's already a .PEM file, it's just that the extension possibly doesn't match. PEM basically consists of a header and footer with base64 encoding in between (some parameters may be encoded right after the header line as well). What you are showing is the PEM header and footer line.