See below a list of commands, commonly used when working with certificates and troubleshooting SSL.
Read certificates
1. Read a PEM certificate
2. Read a PFX/P12 certificate
3. Read a JKS Keystore
Note: depending on the “Entry type” field of each entry (PrivateKeyEntry or trustedCertEntry) you can deduce if your JKS is a keystore or truststore.
A truststore would only contain trustedCertEntry entries
Convert certificates
4.Convert a JKS into a PKCS12 (all aliases)
5.Converting a JKS into a PKCS12 (only one alias)
6.Convert a PKCS12 into a PEM (with password)
Note: You can add -nocerts to only output the private key or add -nokeys to only output the certificates.
7.Convert a PEM certificate and private key into a PKCS12
8.Convert PEM to DER
9.Convert DER to DER
Generate certificates
1.Generate a PEM cert and key
NOTE: This can be used when enabling ssl on Apache or any other webserver.