The keystore would print "Invalid password" when a key was stored using an incorrect public key. This pr improves the error message to communicate better to the user on what is wrong.