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.




How-to: Create a New Managed Server

Creation of a new Managed Server in iWay Service Manager is quite simple and is possible in two different ways. And they are:
 
  • Via Command prompt
  • Via iSM's Systems Tray Utility
iWay Service Manager - Management Section
Section to create a new managed server
First of all, lets create a new entry in Management section of iWay Web Console which will look like this:

Once this is created, follow one of the following two options to install a Windows Service to manage start-up of the managed server.


Via Command Prompt:
 
  • Lanuch Windows Command Prompt; [ ΓΏ + R - CMD [Run as Admin] ]
  • Navigate to the bin folder under root folder of iSM; [<iWay_root>/bin]
  • Type the following command to install a new Windows Service:
    • iwsrv.exe <NEW_MANAGED_SERVER_NAME> -s install -l iWay61.cmd
    • where -l is a swtich to indicate the service which JVM should it use for its execution;
Via iWay Systems Tray Utility:

Find an iSM icon in the systems tray and launch it by double clicking on it. Use the tool to create a new entry which is pretty self-explanatory. Choose the process type as Out-of-process 64 bit and your desired executable Java. The utility looks like what is seen in the image below.


and if iSM icon is visible in Systems tray, it may have not been started up. To start it up, just launch Windows explorer, navigate to the bin folder under root folder of iSM and launch "iwsystray.exe" file. Note: This utility may not be available on iSMs 5.5 or 6.0.X.