1 2 Previous Next 18 Replies Latest reply on Jul 29, 2015 3:17 AM by captain_goldfish Go to original post
      • 15. Re: XML-Signature verification fails
        mayerw01

        Tomaz, I think you got it!

         

        On Window I am using:

        java version "1.8.0_45"

        Java(TM) SE Runtime Environment (build 1.8.0_45-b15)

        Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

         

        Usually I use the same version in Linux. Here the verification responses OK

         

        I made now a test with

        java version "1.7.0_51"

        Java(TM) SE Runtime Environment (build 1.7.0_51-b13)

        Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

         

        This test failed!

        • 16. Re: XML-Signature verification fails
          captain_goldfish

          that's it!

          It's working with JDK 8. But what is wrong that it fails with JDK 7?

          • 17. Re: XML-Signature verification fails
            ctomc

            Pascal Knüppel wrote:

             

            that's it!

            It's working with JDK 8. But what is wrong that it fails with JDK 7?

            But now I have a perfect excuse for my boss who did not want me to use Java 8 so far :-)

            great! and you will be also ready for WildFly 10 as well

            • 18. Re: XML-Signature verification fails
              captain_goldfish

              Hey guys, a colleague found the correct solution for this problem. No hack in the .conf file is needed and also no special JDK. It is much simpler than this, just replace the following lines

               

                      String providerName = System.getProperty("jsr105Provider", "org.jcp.xml.dsig.internal.dom.XMLDSigRI");
              
                      XMLSignatureFactory fac = null;
                      try {
                          fac = XMLSignatureFactory.getInstance("DOM", (Provider) Class.forName(providerName).newInstance());
                      } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
                          throw new InternalCryptoException(e);
                      }
              

               

              with only this:

               

              XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
              

               

              and the problem is gone. The change needs to be done in any method that is using the XMLSignatureFactory.

              1 2 Previous Next