How to list certificates stored in PKCS12 key store using keytool?

I wanted to list the certificates stored in the PKCS12 key store.

The keystore has a .pfx extension

+72
certificate ssl-certificate keystore pkcs # 12
Jan 17 '13 at 8:53
source share
2 answers

If the keystore is of type PKCS12 ( .pfx ), you must specify it with -storetype PKCS12 (line breaks added for readability):

 keytool -list -v -keystore <path to keystore.pfx> \ -storepass <password> \ -storetype PKCS12 
+122
Jan 17 '13 at 8:56
source share

You can also use openssl to achieve the same:

 $ 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 
+15
Feb 10
source share



All Articles