Yu-Jack
8/28/2018 - 2:32 AM

The Most Common OpenSSL Commands

Check a Certificate Signing Request (CSR)

openssl req -text -noout -verify -in CSR.csr

Check a private key

openssl rsa -in privateKey.key -check

Check a certificate

openssl x509 -in certificate.crt -text -noout

Check a PKCS#12 file (.pfx or .p12)

openssl pkcs12 -info -in keyStore.p12

Read PKCS#12 Information

keytool -list -v -keystore xxx.p12 -storetype PKCS12

Read fingerprint

openssl x509 -noout -fingerprint -sha256 -inform pem -in

List truststore (default password is changeit)

keytool -list -v -keystore $JAVA_HOME/jre/lib/security/cacerts

openssl x509 -pubkey -noout -in ~/Downloads/cert\ (1).pem openssl rsa -in /tmp/4c8808e480c1964a0dca73a5a51255fcb0a16b7f0fec07ca259b97f07f527ad5 -pubout