How to convert CRT file to JKS file

CRT is a digital certificates which is used for securing the systems. Conversion is required in some case because each system uses different format of certificates. Now here we are going to see how to convert crt file into java key store file.

Step 1 :
First we need to create the jks file called myfile.jks with the password of jkspassword. We can achieve this by executing below command.After executing below command it will prompt for multiple questions about country,city etc.We need to provide all the relevant information to generate the file.

keytool -genkey -alias temp -keystore myfile.jks -storepass jkspassword

Step 2 :
Delete the any unwanted entries in the jks file by executing below command. This is need there could be a possibility of some spaces in the file

keytool -delete -alias temp -keystore myfile.jks -storepass jkspassword

Step 3 :
Now we need to import the crt file into jks file as like below.

keytool -import -alias -file test.com.crt -keypass keypass -keystore myfile.jks -storepass jkspassword

Now we are done with converting .crt file to .jks file.


Post a Comment

Powered by Blogger.