I wanted to list the certificates stored in the PKCS12 key store.
The keystore has a .pfx extension
.pfx
If the keystore is of type PKCS12 ( .pfx ), you must specify it with -storetype PKCS12 (line breaks added for readability):
-storetype PKCS12
keytool -list -v -keystore <path to keystore.pfx> \ -storepass <password> \ -storetype PKCS12
You can also use openssl to achieve the same:
openssl
$ openssl pkcs12 -nokeys -info \ -in </path/to/file.pfx> \ -passin pass:<pfx password> MAC Iteration 2048 MAC verified OK PKCS7 Encrypted data: pbeWithSHA1And40BitRC2-CBC, Iteration 2048 Certificate bag Bag Attributes localKeyID: XX XX XX XX XX XX XX XX XX XX XX XX XX 48 54 A0 47 88 1D 90 friendlyName: jedis-server subject=/C=US/ST=NC/L=Raleigh/O=XXX Security/OU=XXX/CN=something1 issuer=/C=US/ST=NC/L=Raleigh/O=XXX Security/OU=XXXX/CN=something1 -----BEGIN CERTIFICATE----- ... ... ... -----END CERTIFICATE----- PKCS7 Data Shrouded Keybag: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 2048