I cannot change PKCS keystore password using keytool (java 8). When I tried to change the key password:
keytool -keypasswd -keystore keystore.p12 -storetype PKCS12 -storepass oldpass -keypass oldpass -new newpass
keytool error: java.lang.UnsupportedOperationException: -keypasswd commands not supported if -storetype is PKCS12
It means key password cannot be changed for PKCS12 keystore. Then I tried to change the keystore password:
keytool -storepasswd -keystore keystore.p12 -storetype PKCS12 -storepass oldpass -new newpass
Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified -new value.
keytool error: java.io.FileNotFoundException: keystore.p12 (Access is denied)
It means, we have to change keystore password and keypassword together. But there is no command to change both. What can I do?