Creating a Java keystore

Reading Time: < 1 minute

create a keystore file

$JAVA_HOME/bin/keytool -genkey -alias -keyalg
RSA -keystore keystore.jks -keysize 2048


Generate a certificate signing request (CSR) for an existing Java keystore

$JAVA_HOME/bin/keytool -certreq -alias -keysto
re keystore.jks -file

Import a root or intermediate CA certificate to an existing Java keystore

$JAVA_HOME/bin/keytool -import -trustcacerts -alias root -file
 intermediate.crt -keystore keystore.jks

check certificates in keystore

$JAVA_HOME/bin/keytool -list -v -keystore keystore.jks

Check specific keystore entry using an alias

$JAVA_HOME/bin/keytool -list -v -keystore keystore.jks -alias mydomain


Leave a Reply

Your email address will not be published. Required fields are marked *