keytool command in Java is a tool for managing certificates into keyStore and trustStore which is
used to store certificate and requires during SSL handshake process. By using keytool
command you can do many things but some of the most common operation is
viewing certificate stored in keystore, importing
new certificates into keyStore, delete any certificate from keystore etc.
For those who are not familiar keyStore, trustStore and SSL Setup for Java
application , Here is a brief overview on What is a trustStore and keyStore
in Java. Both trustStore and keyStrore is used to store certificate signed
by signer authority or CA (Certificate authority), with keyStore additionally
storing personal certificate for client which is used during client
authentication on SSL handshake process if its enable. In this article we
will see some basic example of keytool command in Java to find how many
certificates we have in keyStore , viewing those certificates, adding new
certificates and deleting old certificates from keyStore or trustStore in Java.