简体   繁体   中英

Java: Keystore password same as Key(Certificate) password and updating it

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?

Is it feasible that when we change the keystore password it will also change the key password and vice-versa?

Yes, it is. But chaining any of those passwords will be almost "equivalent" to create a new KeyStore...

Without compromising the integrity of keystore and the key?

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!)

Can this be done programmatically?

Yes, see KeyStore javadoc ... (see load , store and setEntry methods)...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM