Generating a Certificate Signing Request (CSR) using Java Based Web Servers
First create Keystore with Keytool. Use commend:
keytool -genkey -keyalg RSA -keysize 2048 -keystore domain.keystore
Enter keystore password: (remember it for later use).
The following questions will be asked:
- What is your first and last name?
- What is the name of your organizational unit?
- What is the name of your organization?
- What is the name of your City or Locality?
- What is the name of your State or Province?
- What is the two-letter country code for this unit?
You will then be asked if the information is correct:
Is CN=www.yourdomain.com, OU=Your Organizational Unit, O=Your Organization, L=Your City, ST=Your State, C=Your Country correct?
When you answer 'y' or 'yes' the password is then requested: Enter key password for <mykey>. Make a note of this password. <mykey> is the default alias for the certificate.
Now you can create CSR with Keytool:
keytool -certreq -keyalg RSA -file domain.csr -keystore domain.keystore
You will be prompted to enter the keystore password - if the password is correct then the CSR is created.
