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
Tweet
Thanks Karim!
ReplyDeleteThank you very much! I had loose 2h hours trying to understand this issue.
ReplyDeleteVery helpful, solved my problem very quickly. Thanks!
ReplyDeleteYou 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.
ReplyDeletethe first command pass fine, but please how can i know "MyKeyAlias" ?
ReplyDeletethank's
It saves my lot of time. Thank you very much
ReplyDeleteThanks man. You saved me. Warm regards from Mexico and Colombia.
ReplyDeleteThanks Man
ReplyDeleteVery, very helpful !
DeleteThanks
Thanks very much!
ReplyDeleteThanks! I appreciate your posting this!
ReplyDeleteGreat Help !
ReplyDeleteThanks!!!
ReplyDeleteI'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!!!
ReplyDeleteHello, I seem to have the same problem. All the details are correct but Android studio cannot recover my keystore. Maybe the keystore file was corrupted. But when I open it it commandline I can see everything is okay. I am afraid I wont be able to update my app on google play.
ReplyDeleteHello, I have created the keystore file .jks format when trying to configure the .jks file format on my tomcat server.xml file i got this error. can please help out me and below i have mention the error details
ReplyDeleteSEVERE: Failed to load keystore type JKS with path C:\Program Files\Apache Software Foundation\Tomcat 7.0\conf\mykeystore.jks due to C:\Program Files\Apache Software Foundation\Tomcat 7.0\conf\mykeystore.jks (The system cannot find the file specified)
java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Tomcat 7.0\conf\mykeystore.jks (The system cannot find the file specified)
Thank you. Much appreciated.
ReplyDeleteTime saver! 10x.
ReplyDeleteThank you , very very much appeciated, + infinity :)
ReplyDeleteThank you so much! Worked perfectly.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHello ,i have got an error ---> keytool error: java.security.UnrecoverableKeyException: Cannot recover key
ReplyDeleteHelp me!
Genius... Working like a charm... Thanks Sir
ReplyDeleteThank you!
ReplyDeleteThank you, the post helped a lot.
ReplyDeleteIt worked from me as well.But Required to bounce applications once .
ReplyDeleteThank You!!!
ReplyDeleteThank You!
ReplyDeleteThank You!!
Thank You!!!