The scenario is that each certificate or key had its own keystore, and the keystore password is the same as the key password.
Is it feasible that when we change the keystore password it will also change the key password and vice-versa? Without compromising the integrity of keystore and the key? Can this be done programmatically or we need to rely on Java's keytool on this?
Yes, it is. But chaining any of those passwords will be almost "equivalent" to create a new KeyStore...
It depends. The best option here is to duplicate the old KeyStore but with the new passwords; later, delete the old KeyStore and rename the new KeyStore as the old one (Here, I'm assuming that your KeyStores are stored in FileSystem!)
Yes, see KeyStore javadoc ... (see
load,storeandsetEntrymethods)...