Skip to content

Instantly share code, notes, and snippets.

@tpowellcio
Created May 24, 2016 12:47
Show Gist options
  • Save tpowellcio/7d54728e5314c18b293350ce4bb1ada7 to your computer and use it in GitHub Desktop.
Save tpowellcio/7d54728e5314c18b293350ce4bb1ada7 to your computer and use it in GitHub Desktop.
These commands allow you to convert certificates and keys to different formats to make them compatible with specific types of servers or software. For example, you can convert a normal PEM file that would work with Apache to a PFX (PKCS#12) file and use it with Tomcat or IIS. Use our SSL Converter to convert certificates without messing with Ope…

#Converting Using OpenSSL

These commands allow you to convert certificates and keys to different formats to make them compatible with specific types of servers or software. For example, you can convert a normal PEM file that would work with Apache to a PFX (PKCS#12) file and use it with Tomcat or IIS. Use our SSL Converter to convert certificates without messing with OpenSSL.

##Convert a DER file (.crt .cer .der) to PEM openssl x509 -inform der -in certificate.cer -out certificate.pem ##Convert a PEM file to DER openssl x509 -outform der -in certificate.pem -out certificate.der ##Convert a PKCS#12 file (.pfx .p12) containing a private key and certificates to PEM openssl pkcs12 -in keyStore.pfx -out keyStore.pem -nodes ###You can add -nocerts to only output the private key or add -nokeys to only output the certificates.

##Convert a PEM certificate file and a private key to PKCS#12 (.pfx .p12) openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment