Java Keytool¶
Java Keytool Commands for Creating and Importing¶
These commands allow you to generate a new Java Keytool keystore file, create a CSR, and import certificates. Any root or intermediate certificates will need to be imported before importing the primary certificate for your domain.
Generate a Java keystore and key pair
Generate a certificate signing request (CSR) for an existing Java keystore
Import a root or intermediate CA certificate to an existing Java keystore
Import a signed primary certificate to an existing Java keystore
Generate a keystore and self-signed certificate (see How to Create a Self Signed Certificate using Java Keytool for more info)
keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048
Java Keytool Commands for Checking¶
If you need to check the information within a certificate, or Java keystore, use these commands.
Check a stand-alone certificate
Check which certificates are in a Java keystore
Check a particular keystore entry using an alias
Other Java Keytool Commands¶
Delete a certificate from a Java Keytool keystore
Change a Java keystore password
Export a certificate from a keystore
List Trusted CA Certs
Import New CA into Trusted Certs