ebourg / jsign

Java implementation of Microsoft Authenticode for signing Windows executables, installers & scripts
https://ebourg.github.io/jsign
Apache License 2.0
250 stars 107 forks source link

NoClassDefFoundError with Bouncy Castle FIPS #116

Closed RenQingWan closed 1 year ago

RenQingWan commented 2 years ago

I used jsign-core in my project,i also used bouncy castle fips version jar,my projec。 an exception occurred :Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder. I have found this class both in bcprove-jdk15on jar and bc-fips jar,they have the same name and location.What can i do? Can I submit code that uses the fips version bouncy castle jar?

ebourg commented 2 years ago

What version of Bouncy Castle do you use?

RenQingWan commented 2 years ago

I used bcpkix-fips 1.0.5,and it has bc-fips 1.0.2.3 I used jsign-core 3.1,and it has bcprov-jdk15on 1.64

ebourg commented 2 years ago

Bouncy Castle FIPS seems to be binary incompatible with the standard version and jsign won't work with it. You can try depending on net.jsign:jsign instead of net.jsign:jsign-core, the all in one jar contains a shaded version of BC that will not conflict with the FIPS version.

RenQingWan commented 2 years ago

ok,i will have a try,thank you for your reply