gpt4 book ai didi

java - 更改Keystore值是否会更改 key 密码?

转载 作者:行者123 更新时间:2023-12-02 08:48:25 25 4
gpt4 key购买 nike

我已更改我的 keystore 密码。我还想更改 keystore 中别名的 key 密码。但使用 -keypasswd

时出现此错误
-keypasswd commands not supported if -storetype is PKCS12

通过更改 keystore 密码,我是否也更改了 key 密码? keystore 中只有一个 key

最佳答案

没有。更改 keystore 密码不会自动更改 key 密码。您必须分别发出相应的更改 keystore 密码 (-storepasswd) 和更改 key 密码 (-keypasswd)。

PKCS12 keystore 格式的互联网标准是它只有1个条目,并且 keystore 密码与 key 密码相同。

我看到 keytool 的工作方式是,当您更改 keystore 或 key 密码时,它不需要 storetype 属性。但是,当您提供 storetype 属性作为 PKCS12 时,如果您提供 keypass 属性,它实际上会提示,说它不会遵守它。

因此,要回答您更改 key 密码的问题,请不要提供 storetype 属性。您的命令应如下所示:

keytool -keypasswd -keystore [p12Keystore] -storepass [oldPassword] -new [newPassword] -alias [entry]

关于java - 更改Keystore值是否会更改 key 密码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60935593/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com