Jan 21, 2025
This article covers the creation of a new Java keystore using Java keytool.
You can watch the video below for a tutorial.
Or, you can check the step by step guidelines below.
keytool -genkey -alias mydomain -keyalg RSA -keystore KeyStore.jks -keysize 2048
keytool -certreq -alias mydomain -keystore KeyStore.jks -file mydomain.csr
Answer each question when prompted. Use the chart below to guide you through the process:
Field | Example |
---|---|
First & Last Name | Domain Name for SSL Certificates Entity Name for Code Signing |
Organizational Unit | Support (Optional, e.g. a department) |
Organization | GMO GlobalSign Inc (Entity's Legal Name) |
City / Locality | Portsmouth (Full City name) |
State / Province | New Hampshire (Full State Name) |
Country Code | US (2 Letter Code) |
Confirm or reject the details by typing "Yes" or "No" and pressing Enter
Press Enter to use the same password as the keystore, alternatively specify a separate password and press enter.
You should now have a file called mydomain.csr which can be used to order or reissue a digital certificate from GlobalSign.
keytool -import -trustcacerts -alias root -file root.crt -keystore KeyStore.jks
keytool -import -trustcacerts -alias intermediate -file intermediate.crt -keystore KeyStore.jks
keytool -import -trustcacerts -alias mydomain -file mydomain.crt -keystore KeyStore.jks
Check your certificate installation for SSL issues and vulnerabilities.