如何进入非密码保护的Java密钥库或更改密码?

我试图导入一个可信任的authentication到Java cacerts密钥库 ,但我有一个问题。 我试图列出现有的可信证书,似乎密钥库没有密码保护。

$ keytool -list -keystore cacerts Enter keystore password: ***************** WARNING WARNING WARNING ***************** * The integrity of the information stored in your keystore * * has NOT been verified! In order to verify its integrity, * * you must provide your keystore password. * ***************** WARNING WARNING WARNING ***************** Keystore type: JKS Keystore provider: SUN Your keystore contains 76 entries 

我试图导入一个可信的证书:

 $ keytool -importcert -alias "JiraCert" -file /root/c9ssl.crt -keystore /etc/java-6-sun/security/cacerts Enter keystore password: Keystore password is too short - must be at least 6 characters Enter keystore password: Keystore password is too short - must be at least 6 characters Enter keystore password: Keystore password is too short - must be at least 6 characters Too many failures - try later 

我也尝试将密码从“无”改为:

 $ keytool -storepasswd -keystore cacerts.back Enter keystore password: Keystore password is too short - must be at least 6 characters Enter keystore password: Keystore password is too short - must be at least 6 characters Enter keystore password: Keystore password is too short - must be at least 6 characters Too many failures - try later 

这意味着cacerts密钥库不受密码保护

这是一个错误的假设。 如果仔细阅读,您会发现提供列表时没有validation密钥库的完整性,因为您没有提供密码。 列表不需要密码,但您的密钥库肯定有一个密码,如下所示:

为了validation其完整性,您必须提供您的密钥库密码。

Java的默认cacerts密码是“changeit”,除非你在Mac上,它的“changeme”直到某一点。 显然,如同Mountain Lion(基于评论和另一个答案),Mac的密码现在也是“changeit”,可能是因为Oracle现在也在处理Mac JVM的分发。

密钥库的密码默认是:“changeit”。 我运行了我在这里input的命令,以导入证书。 我希望你已经解决了你的问题。

现在使用Oracle的Mac Mountain Lion拥有相同的密码。

    Interesting Posts