我在本地机器上生成证书时出现以下错误。
C:\Users\abc>keytool -genkey -alias tomcat -keyalg RSA
Enter keystore password:
keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect
我认为jdk版本有一些问题。我在我同事的机器上运行了同样的命令,它工作得很好。
请分享你的意见。
我在本地机器上生成证书时出现以下错误。
C:\Users\abc>keytool -genkey -alias tomcat -keyalg RSA
Enter keystore password:
keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect
我认为jdk版本有一些问题。我在我同事的机器上运行了同样的命令,它工作得很好。
请分享你的意见。
当前回答
使用changeit作为密码也很重要。
这个命令终于对我有用了(使用jetty):
keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass changeit -validity 360 -keysize 2048
其他回答
java.io.IOException:密钥库被篡改,或者密码不正确
当我将密钥库路径C:\MyWorks\mykeystore更改为C:\MyWorks\mykeystore.keystore时,我解决了这个问题。
总结这一页的建议,我总结出如下内容:
keytool -genkeypair -keystore ~/.android/release.keystore -alias <my_alias> -storepass <my_cert_pass> -keyalg RSA
然后我得到了一组关于我的别名的名称、组织、位置和密码的问题。
如果您已经有了.store文件,则必须使用与生成该文件时相同的密码。所以我的解决方案是:
rm *.store
rm *.cer
这可能听起来很奇怪,但我只是想了解keytool和我的源代码控制我的教程文件和重新运行他们以后!
使用changeit作为密码也很重要。
这个命令终于对我有用了(使用jetty):
keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass changeit -validity 360 -keysize 2048
[root@localhost Certificate]# openssl pkcs12 -export -in
/opt/Certificate/115c99f4c5aa98f5.crt -inkey /opt/Certificate/ravi.in.key -certfile
/opt/Certificate/gd_bundle-g2-g1.crt -out RaviNew.p12
Enter Export Password: <Password>
Verifying - Enter Export Password: <Password>
注意:-上面导出密码写下来的任何地方,因为它是必须创建JKS文件(这是取决于你的选择什么密码你想做)
keytool -importkeystore -srckeystore DigiEduNew.p12 -srcstoretype pkcs12 -destkeystore finaldigiEdu.jks -deststoretype JKS
Importing keystore DigiEduNew.p12 to finaldigiEdu.jks...
Enter destination keystore password: <Any Password >
Re-enter new password: <Any Password >
Enter source keystore password: <.P12 Password >
Entry for alias 1 successfully imported.
Import command completed: 1 entries successfully imported, 0 entries failed or
cancelled
Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12
which is an industry standard format using "keytool -importkeystore -srckeystore
finaldigiEdu.jks -destkeystore finaldigiEdu.jks -deststoretype pkcs12".