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
- Make sure you pass in the
-outform derflag. Otherwiseopensslwill default topemformat x509subcommand stands for X.509 certificate, which is a standard format for public key certificates.