Create a keystore in Java


How to Create a keystore in Java to store private key and self-signed certificate

Java – Download Free EBooks and Whitepapers

C:Usersadmin>“C:Program FilesJavajdk1.8.0″binkeytool -genkey -alias tomca
t -keyalg RSA

 

Cloud Computing – Download Free EBooks and Whitepapers
Java – Download Free EBooks and Whitepapers
Windows – Download Free EBooks and Whitepapers

Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]:  Mitesh Soni
What is the name of your organizational unit?
[Unknown]:  iGATE
What is the name of your organization?
[Unknown]:  iGATE
What is the name of your City or Locality?
[Unknown]:  Gnagar
What is the name of your State or Province?
[Unknown]:  Gu
What is the two-letter country code for this unit?
[Unknown]:  IN
Is CN=Mitesh Soni, OU=iGATE, O=iGATE, L=Gnagar, ST=Gu, C=IN correct?
[no]:
What is your first and last name?
[Mitesh Soni]:
What is the name of your organizational unit?
[iGATE]:
What is the name of your organization?
[iGATE]:
What is the name of your City or Locality?
[Gnagar]:
What is the name of your State or Province?
[Gu]:
What is the two-letter country code for this unit?
[IN]:
Is CN=Mitesh Soni, OU=iGATE, O=iGATE, L=Gnagar, ST=Gu, C=IN correct?
[no]:  yes

Enter key password for <tomcat>
(RETURN if same as keystore password):

This information will be displayed to users who attempt to access a secure page in your application, so make sure that the information provided here matches what they will expect.

The keytool prompt will tell you that pressing the ENTER key automatically uses the same password for the key as the keystore. If you select a different password to the keystore password, you will also need to specify the custom password in the server.xml configuration file.

 

This command will create a new file, in the home directory of the user under which you run it, named “.keystore“.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s