How to reset keystores when you do not know their password?

sorin picture sorin · Jul 23, 2012 · Viewed 30.8k times · Source

For some reason I got this message:

keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect

I know that I cannot "repair" the keystore, but I want to reset the keystore, but don't know how to do it, especially because I do not know the location of the default keystores.

Note: I just want the "blank" them so I restart from default. Still I wasn't even able to detect their location.

How can I list default keystores and their locations with keytool or something similar?

Answer

sorin picture sorin · Jul 23, 2012

Just remove ~/.keystore file, which is the default keystore location.