Closed dev-sg-08 closed 4 years ago
My keystore is password-protected
That sounds as if the keystore password is optional. It is not. And - as we are talking about JKS/JCEKS here - there is no real protection provided by the password. You can simply remove and replace it.
If you open a keystore in keytool without entering a password, then you are basically in a read-only mode. You can list the content but you cannot change anything. But that is just an artificial restriction of keytool, not one of the JKS keystore format. If you have forgotten the keystore password, you can use a simple Java program to "reset" the keystore password (something like this: https://gist.github.com/zach-klippenstein/4631307).
If you open a keystore in KSE without entering a password, there are two possible reasons:
My keystore is password-protected, but it's possible to open it without entering the passphrase (skips the integrity check according description in #122).
With keytool you must always entering the old password:
keytool -storepasswd -keystore /opt/java/java11/lib/security/cacerts Enter keystore password: changeit New keystore password: new-password Re-enter new keystore password: new-password