====== Convert certificates with OpenSSL ======
===== DER =====
openssl x509 -inform der -in certificate.cer -out certificate.pem
===== PEM =====
openssl x509 -outform der -in certificate.pem -out certificate.der
openssl crl2pkcs7 -nocrl -certfile certificate.cer -out certificate.p7b -certfile CACert.cer
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt
===== PFX =====
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.
===== P7B =====
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer
openssl pkcs12 -export -in certificate.cer -inkey privateKey.key -out certificate.pfx -certfile CACert.cer
===== Other commands =====
openssl rsa -in privkey.pem -pubout > key.pub
openssl rsa -in [file1.key] -out [file2.key]