7

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

Warok
  • 185
  • 1
  • 2
  • 6
  • 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. – Patrick Mevzek Nov 25 '19 at 17:39

2 Answers2

13

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
garethTheRed
  • 4,539
  • 14
  • 22
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
perko
  • 56
  • 3