invalid SHA1 signature file digest

后端 未结 3 660
耶瑟儿~
耶瑟儿~ 2020-12-15 05:55

I have been trying to verify the Jar signing:

    jarsigner -verify -verbose -certs example.jar

I got the following problem:



        
相关标签:
3条回答
  • 2020-12-15 06:24

    Here is the solution:

    jarsigner -keystore mykeystore -digestalg SHA1 jarfile alias
    

    To verify:

    jarsigner -verify -verbose -certs jarfile
    
    0 讨论(0)
  • 2020-12-15 06:33

    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.

    0 讨论(0)
  • 2020-12-15 06:36

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

    <!-- VLS2014 ADDED digestalg="SHA1" -->
    <signjar keystore="${security.keystore}"
             storepass="${security.storepass}"
             keypass="${security.keypass}"
             alias="${security.alias}"
             jar="${basedir}/temp/tj/${justfname}"
             signedjar="${real.signed.jar}"
         digestalg="SHA1"
            />
    
    <delete file="${basedir}/temp/tj/${justfname}" />
    </target>
    
    0 讨论(0)
提交回复
热议问题