Itextpdf 5.5.x with Bouncycastle

0

Good morning,

I have a signed applet with the version com.powagie.itext 2.1.7 and bouncycastle jdk16 and I am trying to migrate it to the new version itextpdf 5.5.10. I am having problems with the maven configuration for the bouncycastle library since I can not find out which one is correct for this version of itextpdf.

My current configuration is:

        <dependency>
        <groupId>com.lowagie</groupId>
        <artifactId>itext</artifactId>
        <version>2.1.7</version>
        <exclusions>
            <exclusion>
                <artifactId>bcprov-jdk14</artifactId>
                <groupId>org.bouncycastle</groupId>
            </exclusion>
            <exclusion>
                <artifactId>bcmail-jdk14</artifactId>
                <groupId>org.bouncycastle</groupId>
            </exclusion>
            <exclusion>
                <artifactId>bcmail-jdk14</artifactId>
                <groupId>bouncycastle</groupId>
            </exclusion>
            <exclusion>
                <artifactId>bcprov-jdk14</artifactId>
                <groupId>bouncycastle</groupId>
            </exclusion>
            <exclusion>
                <artifactId>bctsp-jdk14</artifactId>
                <groupId>org.bouncycastle</groupId>
            </exclusion>
        </exclusions>
    </dependency>


    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcmail-jdk16</artifactId>
        <version>1.45</version>
    </dependency>
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk16</artifactId>
        <version>1.45</version>
    </dependency>
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bctsp-jdk16</artifactId>
        <version>1.45</version>
    </dependency>

I have seen that they recommend the following configuration:

    <dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>itextpdf</artifactId>
        <version>5.5.10</version>
    </dependency>
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk15on</artifactId>
        <version>1.49</version>
    </dependency>

But I get an error with the library "mityc":

UtilidadDNIe.getCN(certificate, UtilidadDNIe.SUBJECT_OR_ISSUER.SUBJECT) + " (" + (UtilidadDNIe.getCN(certificate, UtilidadDNIe.SUBJECT_OR_ISSUER.ISSUER)) + ")";
  

java.lang.NoSuchFieldError: CN       at es.mityc.firmaJava.libreria.utilidades.UtilidadDNIe.getCN (UtilidadDNIe.java:83)

Any ideas please? Thank you.

EDIT: I have already found the problem. It was one of Mityc's bookstores. There was a reference to the same library with another version:

        <dependency>
        <groupId>es.mityc.jumbo.adsi</groupId>
        <artifactId>MITyCLibAPI</artifactId>
        <version>${mityc.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcmail-jdk16</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk16</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bctsp-jdk16</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

With this it is solved. Thanks!

    
asked by Kike MC 21.11.2016 в 12:11
source

0 answers