Search code examples
javabouncycastle

class "org.bouncycastle.cms.CMSProcessable"'s signer information does not match signer information of other classes


I am using jpasskit for ios passes creation and try to sign passes using bouncycastle. I am facing some issue using jpasskit:

 java.lang.SecurityException: class "org.bouncycastle.cms.CMSProcessable"'s signer information does not match signer information of other classes in the same package

POM details:

<dependency>
    <groupId>de.brendamour</groupId>
    <artifactId>jpasskit</artifactId>
    <version>0.0.9</version>   

       <exclusions>
                <exclusion>  
          <groupId>org.bouncycastle</groupId>
          <artifactId>bctsp-jdk14</artifactId>
        </exclusion>

                <exclusion>  
          <groupId>org.bouncycastle</groupId>
          <artifactId>bcpkix-jdk14</artifactId>
        </exclusion>

                <exclusion>  
          <groupId>org.bouncycastle</groupId>
          <artifactId>bcprov-jdk14</artifactId>
        </exclusion>

          </exclusions> 

      </dependency>

Please help.


Solution

  • This happens when classes belonging to the same package are loaded from different JAR files, I had the same problem and in my case different BouncyCastle's versions where included as dependencies by different libraries I was using.
    I see you already have some exclusions in your POM, try to exclude ALL the conflicting/overlapping versions. In your dependency tree look for bcmail-jdk{version}-{version}.jar, bcprov-jdk{version}-{version}.jar etc... and keep only one version of them.