Java - Change keystore or truststore password using the java keytool command
by
Jeremy Canfield |
Updated: July 22 2022
| Java articles
If you are not familiar with the Java keytool command, check out our Getting Started article.
Let's say you have a Java keystore or truststore file named "trusted_certs" in the /usr/local/certs directory. If the Java keystore or truststore is password protected, you will be prompted for the password.
~]$ keytool -list -keystore "/usr/local/certs/trusted_certs"
Enter keystore password:
Or, the -storepass option can be used to provide the password on the command line.
keytool -keystore cacerts -storepass itsasecret -list
The -storepasswd option can be used to update the password that is used for the Java keystore or truststore file.
~]$ keytool -keystore cacerts -storepasswd
Enter keystore password: <current password>
New keystore password: <new password>
Re-enter new keystore password: <new password>
Did you find this article helpful?
If so, consider buying me a coffee over at