How to Convert SSL Certificate From CER to DER Format

Today I learned how to convert SSL certificate that is using crt format to der format while working on updating the certificate that was pinned in our iOS app. Here’s a quick guide on the how-to.

First of all make sure you have openssl installed in your machine. Then run the following command in your terminal:

openssl x509 -in input_cert.crt -out output_cert.der -outform der

Make sure to replace input_cert.crt and output_cert.der with the actual filenames of your certificates.

That’s it. Easy right?

Additional info

  1. Make sure you pass in the -outform der flag. Otherwise openssl will default to pem format
  2. x509 subcommand stands for X.509 certificate, which is a standard format for public key certificates.