jarsigner error: java.lang.RuntimeException: keyst

2019-06-15 00:56发布

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!

5条回答
仙女界的扛把子
2楼-- · 2019-06-15 01:35

Check your keystore alias name once. Some times keystore alias name is different from keytool alias name then it gives the same error...So check it alias names once

查看更多
够拽才男人
3楼-- · 2019-06-15 01:40

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.

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.

For example, instead of

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

try

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

查看更多
4楼-- · 2019-06-15 01:51

My problem was that I was putting the password in the command with the -storepass and -keypass switches (which is a bad idea anyway) and on my system Jarsigner was having none of it. Once I pulled those out and allowed Jarsigner to prompt me for the passwords it worked as expected.

查看更多
贪生不怕死
5楼-- · 2019-06-15 01:57

The error message you are getting describes the problem. Either you've typed your password incorrectly or the keystore has become corrupted.

The most likely answer is that you've confused the keystore password with the password for the alias/keypass.

查看更多
不美不萌又怎样
6楼-- · 2019-06-15 02:02

I had the exact opposite issue to @Peter I had special characters in my password and my signing script kept giving this error until I wrapped the password in double quotes "

I think this was because I was running a batch file to sign my app rather than typing it directly into the command line and windows was getting confused about the special characters in the password.

查看更多
登录 后发表回答