Thursday, February 27, 2014

How-To: Create a Java Keystore and KeyPair for Authentication

I wanted to show how to create a new java key store and generate a key pair which can be used for SSL connectivity and client authentication purposes. Read further to know more.
 
Entities Involved:

Keystore Explorer - Download Location

Assumptions:
  • Basic knowledge on keystore/certificate handling;
  • keystore explorer had been downloaded and installed for use;
Keywords & Extensions:

KS [Keystore Explorer]

Procedure:

Launch KS and select "Create a New KeyStore" as seen in screen below:















Choose JKS as the type for the new keystore we will be creating as it is the most common and will look like what is seen in the image below:

 
 
Save the keystore with a keystore password when prompted, just like this:
 
Now that we have a keystore created to hold all our keys and certificates, let us try & create a new key pair. Navigate to Tools in the menu bar and choose "Generate Key Pair":









Select the algorithm as DSA and the key size as 2048 [or anything else as desired]

 
Choose the key pair properties appropriately, as required:

 
Supply the certificate properties as seen below:









Save the entry and supply an alias name when prompted for it:








which will make the keystore look like this:




Which is how one can create a JKS and a keypair easily. Thanks to Lazgo Software & Wayne Grant for offering such an excellent tool absolutely free of cost.




No comments:

Post a Comment