Creating a Java keystore

Reading Time: < 1 minute

create a keystore file

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

keystore1

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

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

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

f