Wednesday 18 February 2015

View Contents of keystore Java without knowing keystore password - stolen idea!!

                                 
                                                            Contents of Key Store


This evening at work , my jenkins  release stopped working .

Reason : It was building properly but was not able to release to artifactory . Upon investigation and beating my head around , found that the certificate used for the connection b/w jenkins and artifactory had expired.

So I had to import new certificate to my JDK cacerts . But before doing it I wanted to view the contents of my cacerts.

Viewing was easy ,

                          keytool -list -keystore <keystore-location>

but then it asked me for the keystore password and as most of the times i didnt remember it.

So falling back to the basic option : GOOGLE

3rd link pointed me to a wonderful code at

                https://gist.github.com/zach-klippenstein/4631307

The code helped me to create a new keystore with a new password and after this I ran the keytool code again and woooosh everything was there.


Little bit of hack but helps in dire needs.