Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the alias name in the keystore file

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.

like image 725
user903676 Avatar asked Jan 23 '15 07:01

user903676


People also ask

What is alias name in keystore?

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.

What is key pair alias?

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.

What is release key alias in 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.


2 Answers

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" 
like image 56
SubOptimal Avatar answered Sep 19 '22 19:09

SubOptimal


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.

like image 25
yohanfernando Avatar answered Sep 21 '22 19:09

yohanfernando