jarsigner 错误:java.lang.RuntimeException:密钥库加载:密钥库被篡改,或密码不正确 [英] jarsigner error: java.lang.RuntimeException: keystore load: Keystore was tampered with, or password was incorrect

查看:95
本文介绍了jarsigner 错误:java.lang.RuntimeException:密钥库加载:密钥库被篡改,或密码不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Java 6 的 jarsigner 对 .wgt 文件(小部件,它是一个 jar 文件)进行签名.但是当我尝试签名时,在要求输入密钥库的密码后,它给了我以下错误.

I am trying to sign a .wgt file(widget which is a jar file) using jarsigner of Java 6. But when I try to sign, it gives me the following error, after asking to enter the passphrase for keystore.

jarsigner error: java.lang.RuntimeException: keystore load: Keystore was tampered with, or password was incorrect

我什至尝试使用新创建的密钥库,因此我确定我输入了正确的密码.还有其他可能出错的地方吗?提前致谢!

I even tried with a newly created key store, So that I am sure I am entering the correct password. Is there anything else which could have been gone wrong? Thanks in advance!

推荐答案

如果您引用了密码,请尝试删除引号.我在 Windows 7 上的 1.7.0_25-b17 JDK 中使用 jarsigner 时遇到此错误.我通常在 Solaris 和 Linux 上使用早期版本的 jarsigner,并且总是使用单引号引用密码,因为它通常包含由 shell 解释的字符.

If you're quoting the password, try removing the quotes. I experienced this error when using jarsigner in the 1.7.0_25-b17 JDK on Windows 7. I typically use earlier versions of jarsigner on Solaris and Linux and have always quoted the password using single quotes because it often contains characters that are interpreted by the shell.

我还没有验证,但我猜测 *nix 上的 shell 解释器在将参数传递给 jarsigner 之前会修剪引号,但 Windows 命令提示符没有.

I haven't verified, but I'm guessing that the shell interpreter on *nix trims quotes before passing the parameters to jarsigner, but the Windows command prompt doesn't.

例如,代替

jarsigner -keystore/my/cert/file -storepass 'password'/my/jar/file my_alias

试试

jarsigner -keystore/my/cert/file -storepass 密码/my/jar/file my_alias

这篇关于jarsigner 错误:java.lang.RuntimeException:密钥库加载:密钥库被篡改,或密码不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆