6

I have exported my certificates in DER encodig (with the extension .cer). Is there a way to convert those certificates in Base-64 encoding (with the same extension)? Thanks

1
  • 1
    The extension (as all the filename) is irrelevant. It only exists to make human life easier, computers do not care, only the content of the file matters for them. "Base-64 encoding" is called PEM in the "SSL" world. Nov 25, 2019 at 17:39

2 Answers 2

4

To convert from a DER to a base64, you can use certutil :

certutil -encode filename.cer newfilename.cer

And from a base64 to a DER, you can use :

certutil -decode filename.cer newfilename.cer
2
  • Tanks for the help ;)
    – Warok
    Nov 21, 2019 at 11:26
  • 1
    certutil is not part of the OpenSSL suite of tools as far as I know. Nov 21, 2019 at 14:52
12

As you have the openssl tag on your question, you should use:

openssl x509 -inform der -in infile.cer -out outfile.cer

In the reverse direction:

openssl x509 -outform der -in infile.cer -out outfile.cer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.