【问题标题】:class "org.bouncycastle.asn1.ASN1Primitive"'s signer information does not match signer information of other classes in the same package类“org.bouncycastle.asn1.ASN1Primitive”的签名者信息与同一包中其他类的签名者信息不匹配
【发布时间】:2014-04-30 19:32:33
【问题描述】:

我正在尝试调用以下行...

PdfCopy copy = null;
...
copy.setEncryption(password.getBytes(), null, PdfWriter.ALLOW_PRINTING | PdfWriter.ALLOW_COPY, PdfWriter.ENCRYPTION_AES_128)

我明白了

java.lang.SecurityException: 类“org.bouncycastle.asn1.ASN1Primitive”的签名者信息与同一个包中其他类的签名者信息不匹配

这似乎与 Grails 和以前版本的充气城堡有关,所以我尝试将以下内容添加到我的 pom...

    <dependency>
        <groupId>org.grails.plugins</groupId>
        <artifactId>rendering</artifactId>
        <version>0.4.4</version>
        <scope>compile</scope>
        <type>zip</type>
        <exclusions>
            <exclusion>
                <groupId>bouncycastle</groupId>
                <artifactId>bcmail-jdk14</artifactId>
            </exclusion>
            <exclusion>
                <groupId>bouncycastle</groupId>
                <artifactId>bcprov-jdk14</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <!-- Needed for rendering plugin -->
    <dependency>
        <groupId>org.xhtmlrenderer</groupId>
        <artifactId>core-renderer</artifactId>
        <version>R8</version>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <groupId>bouncycastle</groupId>
                <artifactId>bcmail-jdk14</artifactId>
            </exclusion>
            <exclusion>
                <groupId>bouncycastle</groupId>
                <artifactId>bcprov-jdk14</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    ...
    <dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>itextpdf</artifactId>
        <version>5.3.2</version>
    </dependency>
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk15on</artifactId>
        <version>1.47</version>
    </dependency>
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcmail-jdk15on</artifactId>
        <version>1.47</version>
    </dependency>
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bctsp-jdk15</artifactId>
        <version>1.46</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

但没有骰子....我正在使用 Grails 2.3.7 有人有什么建议吗?

另外,当我运行 mvn dependency:tree -Dverbose 时,我看不到任何其他引用。

【问题讨论】:

    标签: grails bouncycastle


    【解决方案1】:

    问题与 grails-doc 插件有关。我通过运行grails dependency-report 发现了这一点,这显示了 grails-doc 中的旧 iText 依赖项。

    在 BuildConfig 中排除这个可以正常工作。

    基本上这个...

    How to exclude grails global dependency

    【讨论】:

      猜你喜欢
      • 2017-08-30
      • 1970-01-01
      • 1970-01-01
      • 2014-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-14
      • 1970-01-01
      相关资源
      最近更新 更多