invalid SHA1 signature file digest

匿名 (未验证) 提交于 2019-12-03 02:00:02

问题:

I have been trying to verify the Jar signing:

    jarsigner -verify -verbose -certs example.jar 

I got the following problem:

jarsigner: java.lang.SecurityException: invalid SHA1 signature file digest for o rg/apache/log4j/net/DefaultEvaluator.class 

I got some suggestions about using -digestalg SHA-1 but I do not know where I should put this statement!

I hope you can help me to fix the problem.

回答1:

This error can also happen when the jar is signed twice.

The solution was to 'unsign' the jar by deleting *.SF, *.DSA, *.RSA files from the jar's META-INF and then signing the jar again.



回答2:

Here is the solution:

jarsigner -keystore mykeystore -digestalg SHA1 jarfile alias 

To verify:

jarsigner -verify -verbose -certs jarfile 


回答3:

This worked for me. I had to change my ANT to version 1.8.3 and add DIGESTALG attribute:

 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!