SSL Certificate/Key Conversions

cambridge-kings-college

Tips on how to deal with certificates created by our Windows certificate server.

Our certificate server issues certificates in DER a binary format. However, it’s common for unix software to deal with certificates in PEM a base-64 version of DER.

PEM certs are great if you want to copy and past a certificate in a web form, etc.

The following are conversions using OpenSSL:

  1. To convert a certificate from PEM to DER:
  2. x509 –in input.crt –inform PEM –out output.crt –outform DER
  3. To convert a certificate from DER to PEM:
  4. x509 –in input.crt –inform DER –out output.crt –outform PEM
  5. To convert a key from PEM to DER:
  6. rsa –in input.key –inform PEM –out output.key –outform DER
  7. To convert a key from DER to PEM:
  8. rsa –in input.key –inform DER –out output.key –outform PEM