Skip to main content

Java Keystore - Certificate management

 Java Keystore - Certificate Management

Dealing with the Java keystore is not new for the software developers working with Java.

But many a times, developers who work with several other technology stack come across the necessity of dealing with java keystoe(jks).

A simple, easy way to deal with it is given below.

The software

The software I am working with is KeyStore Explorer. 



This software can be used on Windows, Linux and MacOS. Installable can be downloaded separately. If you are fan of portable apps, you can download the zip version that will work with all the operating systems. This software can be downloaded from the link below 

https://keystore-explorer.org/downloads.html

Setup

Install as per your operating system. For portable version, simply unzip to the desired folder.

The Keystore explorer needs a JRE to run. If your laptop has a pre-installed JRE, please make sure the JAVA_HOME environment variable is set.

If you already have a portable JRE, you can copy the JRE folder in the installation directory of the KeyStore Explorer.

Working with KeyStore Explorer

Creating a new keystore

  1. Open the KeyStore Manager (kse.exe/ kse.sh)
  2. Click on the new button on the left top corner (or File-> New)
  3. Choose the type of keystore preferred(PKCS12 and JKS being mostly used)
  4. Now add your certificates to the keystore using the "Import Trusted Certificate" option. Simply click and browse the certificate to add it to the keystore.
  5. Save your keystore- Click on the Save button on the options or File ->Save or Save As, choose the target location and the target filename.
  6. When saving the keystore, it will ask you to set and confirm the password for the keystore. Please make sure to keep this information safe as you would need this in future when using the keystore.

Note : Please make sure to append the file extension as you prefer. The software does not automatically add the filename extension.

Opening and editing a keystore

  1. Open the KeyStore Manager (kse.exe/ kse.sh)
  2. Click on the Open button or File -> Open option.
  3. Browse and select your jks file.
  4. It will ask for the keystore password, please enter it in the password box.

Now the keystore is opened for viewing and editing. You can add new certificates or keys to the keystore or remove the expired certificates and keys from the store.


Comments

Popular posts from this blog

Public private key based login to Unix computer

Public private key based login to Unix computer We know that we can login to a Unix system in several ways. One drawback with username password mode is that there will be requirement to update the password frequently. In such cases, we go for the public key based login.  Required software 1. Putty and puttygen Putty can be downloaded from the download page of  https://www.putty.org/ The downloaded zip contains both putty and puttygen. 2. Winscp This is an optional software which gives a window when dealing with ssh, ftp, sftp connections. This can be downloaded from their official site. https://winscp.net/eng/download.php How it works In the public key based login, we will generate a public key and corresponding private key pair. We can optionally protect the private key using a password so that if someone gets your private key, they wont be able to put it into real use [The secret would be needed for loading your private key to the ssh client]. Process Create the public - private k

PDF files : Merge pdf files into one , extract the pages into new one

 Today, we will take a look into he pdf file management. Many a times we come across situations where  1. We have to extract certain pages of a large pdf file. 2. We have merge several pdf files into a single pdf file. We are covering the basic usage below. We are using Ubuntu Linux for this exercise. Merge several files into a single file 'Pdfunite' is the utility that I will be using today. In my example, I have 3 input files (pdf1.pdf, pdf2.pdf, pdf3.pdf)   Place all the files to be merged in a folder. Use the terminal to navigate to the folder. Execute the command as below: pdfunite is the utility, then we list out all the files in the sequence it has to be added to the resulting file. The last name is the name of the resulting file. The file will be created by the utility. pdfunite pdf1.pdf pdf2.pdf pdf-result.pdf  Now you can see that there is a new large file created using the given input pdf files.  Extract certain pages from a PDF file I am using the 'pdfseparate&#

Linux - How to find all the files that contains a given string

Linux - Find all files that contains a given string. In order to find all the files that contains a given string, we can make use of several commands. One of the simplest option is to use the grep command. grep -R '/path/to/theFiles/' -e 'pattern-to-search' With this execution, grep will go through all the files in the provided location recursively(since we gave -R option) and look for the string-pattern to look for. Then, it will provide a list of files that contains our given string-pattern.