Find the alias name in the keystore file

user903676 picture user903676 · Jan 23, 2015 · Viewed 69.5k times · Source

I have a key store file cacerts under jre/lib/security in which i added a Certicate by using the import command.

There are more than 50 certificates in my keystore. How do i find the alias name of the last imported certificate in the keystore. I want to delete the last added certificate for which i need the alias name. Kindly help.

Answer

SubOptimal picture SubOptimal · Jan 23, 2015

You can list all certificates in the keystore like

on Linux

keytool -list -v -keystore keystore.jks | grep "Alias name\|Creation date"

on Windows

keytool -list -v -keystore keystore.jks | findstr "Alias Creation"