类“ org.bouncycastle.cms.CMSProcessable”的签名者信息与其他类的签名者信息不匹配

时间:2018-07-02 12:52:59

标签: java bouncycastle

我正在使用jpasskit来创建ios通行证,并尝试使用bouncycastle签署通行证。我在使用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详细信息:

<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>

请帮助。

3 个答案:

答案 0 :(得分:0)

当从不同的JAR文件加载属于同一个程序包的类时,会发生同样的问题,在我的情况下,会出现不同的BouncyCastle版本,这些版本被我使用的不同库作为依赖项包含在内。 我看到您的POM中已经有一些排除项,请尝试排除所有冲突/重叠的版本。在依存关系树中查找 bcmail-jdk {version}-{version} .jar bcprov-jdk {version}-{version} .jar 等...并保留其中一个版本。

答案 1 :(得分:0)

enter image description here我尝试删除所有依赖项。但是仍然遇到相同的问题。请提出建议 http://maven.apache.org/maven-v4_0_0.xsd“>     4.0.0

<artifactId>Sky30RestAPI</artifactId>

<packaging>jar</packaging>
<name>Simple CXF JAX-RS webapp service using spring configuration</name>
<description>Simple CXF JAX-RS webapp service using spring configuration</description>

<parent>
    <groupId>com.greenlots.sky30</groupId>
    <artifactId>Sky30Root</artifactId>
    <version>${build.number}</version>
    <relativePath>../Sky30Root</relativePath>
</parent>

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

<exclusions>
    <exclusion>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcpkix-jdk15on</artifactId>
    </exclusion>
</exclusions>
</dependency>
    <dependency>
        <groupId>com.greenlots.sky30</groupId>
        <artifactId>Smart3ToOCPPProtocol</artifactId>
        <version>${build.number}</version>
    </dependency>

    <dependency>
        <groupId>com.greenlots.sky30</groupId>
        <artifactId>Smart3ToOCPPProtocolImpl</artifactId>
        <version>${build.number}</version>
    </dependency>

    <dependency>
        <groupId>com.greenlots.sky30</groupId>
        <artifactId>GLExceptions</artifactId>
        <version>${build.number}</version>
    </dependency>

    <dependency>
        <groupId>com.greenlots.sky30</groupId>
        <artifactId>Utilities</artifactId>
        <version>${build.number}</version>
    </dependency>

    <dependency>
        <groupId>com.greenlots.sky30</groupId>
        <artifactId>Sky30BusinessContract</artifactId>
        <version>${build.number}</version>
    </dependency>

    <dependency>
        <groupId>com.greenlots.sky30</groupId>
        <artifactId>DeviceReportDispatcher</artifactId>
        <version>${build.number}</version>
    </dependency>

    <dependency>
        <groupId>com.greenlots.sky30</groupId>
        <artifactId>Sky30Business</artifactId>
        <version>${build.number}</version>
    </dependency>

    <dependency>
        <groupId>com.greenlots.sky30</groupId>
        <artifactId>SkyBMWRestAPIv1.0</artifactId>
        <version>${build.number}</version>
    </dependency>

    <dependency>
        <groupId>com.greenlots.sky30</groupId>
        <artifactId>IVRManagement</artifactId>
        <version>${build.number}</version>
    </dependency>




    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-ws-security</artifactId>
        <version>${cxf.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk15on</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports</artifactId>
        <version>6.3.0</version>
        <exclusions>
            <exclusion>
                <groupId>bouncycastle</groupId>
                <artifactId>bcprov-jdk14</artifactId>
            </exclusion>                
            <exclusion>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk14</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcmail-jdk14</artifactId>
            </exclusion>

            <exclusion>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bctsp-jdk14</artifactId>
            </exclusion>
            <exclusion>
                <groupId>bouncycastle</groupId>
                <artifactId>bcmail-jdk14</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
            <groupId>org.bouncycastle</groupId>
                <artifactId>bcmail-jdk15on</artifactId>
                <version>1.49</version>

    </dependency>   
</dependencies>
<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>default-cli</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <port>13000</port>
                            <path>/jaxrs-service</path>
                            <useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <configuration>
                    <projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
                    <wtpmanifest>true</wtpmanifest>
                    <wtpapplicationxml>true</wtpapplicationxml>
                    <wtpversion>2.0</wtpversion>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>

</build>

答案 2 :(得分:0)

我的jar仍未从元数据中删除。我的问题现在已解决。再次感谢!!。D:\ greenlot_45_workspace.metadata.plugins \ org.eclipse.wst.server.core \ tmp1 \ wtpwebapps \ Sky30Web \ WEB -INF \ lib

相关问题