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.
An alias is specified when you add an entity to the keystore using the -genseckey command to generate a secret key, -genkeypair command to generate a key pair (public and private key) or the -importcert command to add a certificate or certificate chain to the list of trusted certificates.
An alias is an identifying character string, such as mykey or johnkey02 , that distinguishes a key pair from other key pairs stored in the same keystore. An alias must be unique within a single keystore.
The Key Alias is a just a commonplace name that points to a specific certificate. You can create one for each release, or just use the same one for all your apps. I suggest creating one for each app, and making sure you back up multiple copies.
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"
Have you tried listing all certificates.
keytool -list -v -keystore keys.store
It may be in the order they were added.
Also if you added the certificate via command prompt or terminal check history.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With