Sunday, 8 December 2013

Adding external self signed certificate To cacerts of JVM installed in our machoine

1. Export a certificate from browser by clicking key symbol on browser
2. Save this certificaste as anyname.cer in C:\Program Files\Java\jdk1.6.0_34\jre\lib\security\ location in my case its anyname.cer I have copied cer file in same location
3. then open a command prompt navigate through C:\Program Files\Java\jdk1.6.0_34\jre\lib\security\
4. Then execute the following command
keytool -import -file anyname.cer -alias aliasnamecert -keystore cacerts

give "changeit" as password .. its default password. of java cacerts.. here we are adding the my self signed certificate to our cacerts

you will get the command promt response as bellow.

C:\Program Files\Java\jdk1.6.0_34\jre\lib\security>keytool -import -file anyname.cer -alias aliasnamecert -keystore cacerts
Enter keystore password:
Owner: CN=kummitha.blogspot.in, OU="kummitha, Inc.", O=Information Systems Division, L=JubileeHills, ST=Hyderabad, C=IN
Issuer: CN=RSCESS01, DC=kummitha.blogspot, DC=in

He you will see certification information


Trust this certificate? [no]:  yes
Certificate was added to keystore

C:\Program Files\Java\jdk1.6.0_34\jre\lib\security>


===================================================================
After this you can verify the certificate path using following command,

C:\Program Files\Java\jdk1.6.0_34\jre\lib\security>keytool -list -v -keystore cacerts  > java_cacerts.txt
Enter keystore password:  changeit

C:\Program Files\Java\jdk1.6.0_34\jre\lib\security>

see the java_cacerts.txt file
======================================================================

No comments:

Post a Comment