Reputation: 6786
I've changed my Keystore password. I also want to change a key password for an alias in the keystore. But I get this error when using -keypasswd
-keypasswd commands not supported if -storetype is PKCS12
By changing the keystore password have I also changed the key password? There is only one key in the keystore
Upvotes: 0
Views: 759
Reputation: 4840
No. Changing the keystore password doesn't change the key password automatically. You have to issue the respective change keystore password (-storepasswd
) and change key password (-keypasswd
) separately.
The internet standard for the PKCS12 keystore format is it has only 1 entry, and the keystore password is the same as the key password.
The way I've seen keytool
work is, it doesn't need the storetype
attribute when you change the keystore or key password. But when you supply the storetype
attribute as PKCS12
it actually complains if you supply the keypass
attribute, saying that it will not honor it.
So to answer your question to change the key password, don't supply the storetype
attribute. Your command should look like:
keytool -keypasswd -keystore [p12Keystore] -storepass [oldPassword] -new [newPassword] -alias [entry]
Upvotes: 1