How to convert a number of formats to PEM format

The OpenSSL command can be used to convert certificates of another format to PEM format.

Converting a certificate in DER encoding to PEM format

A certificate in DER encoding has the extension .crt. To convert for example a vsign3 certificate to PEM format use this OpenSSL command:

  • openssl x509 -inform der -in vsign3.crt -out vsign3.pem
Converting a client certificate in PKCS12 format to PEM format

A client certificate from PKCS12 format has the extension .pfx. To convert for example a ccapi client certificate to PEM, take these steps:

  1. Type the OpenSSL command:

    openssl pkcs12 -in ccapi.pfx -out ccapi.pem

  2. If the pkcs12 file is password protected, OpenSSL will prompt for the password. Specify the Import Password.
  3. When the password is accepted OpenSSL displays the message: "MAC verified OK"
  4. OpenSSL will then prompt you for a new password (or pass phrase). Specify the new pass phrase.
  5. Re-enter the same pass phrase, to verify the pass phrase when OpenSSL prompts you with the message: "Verifying - Enter PEM pass phrase:"
  6. When re-entering the password was successful, OpenSSL will exit.
  7. On failure OpenSSL will report Verify failure.