Wednesday, July 14, 2010

java.io.IOException: Cannot recover key (Errors & Solutions #5)

Error

java.io.IOException: Cannot recover key


Solution

The KeyStore password and The Key password should be the same :)
Changing both passwords using keytool

Change KeyStore password
keytool -storepasswd -new newpassword -keystore KeyStore.jks
Change Alias key Password
keytool -keypasswd -alias MyKeyAlias -new newpassword -keystore KeyStore.jks

Note: supply old password for both keystore and alias when asked for


15 comments:

  1. Thank you very much! I had loose 2h hours trying to understand this issue.

    ReplyDelete
  2. Very helpful, solved my problem very quickly. Thanks!

    ReplyDelete
  3. You sir have just made my life SO much easier. Keys in future will be exported using the same password as my keystore. Thank you very much.

    ReplyDelete
  4. the first command pass fine, but please how can i know "MyKeyAlias" ?

    thank's

    ReplyDelete
  5. It saves my lot of time. Thank you very much

    ReplyDelete
  6. Thanks man. You saved me. Warm regards from Mexico and Colombia.

    ReplyDelete
  7. Replies
    1. Very, very helpful !

      Thanks

      Delete
  8. Thanks very much!

    ReplyDelete
  9. Thanks! I appreciate your posting this!

    ReplyDelete
  10. I'm creating a lab exercise for HP SiteScope to run via TLS/SSL and your article just let me fix a show-stopper. THANK YOU!!!

    ReplyDelete