Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 334
Tony Avatar asked Sep 14 '17 09:09

Tony


Video Answer


1 Answers

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.

like image 200
Maarten Bodewes Avatar answered Jan 02 '23 18:01

Maarten Bodewes