Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XAdES, xml issue with Java 7u25

ValentinoJul 1 2013 — edited Jul 4 2013

Hi all,

my XAdES Java implementation code works on Java 6 and all updates of Java 7 until Java 7u25. In Java 7u25 the code:

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

List<Reference> refs = new ArrayList<Reference>();

Reference ref1 = fac.newReference("", fac.newDigestMethod(DigestMethod.SHA1, null), Collections.singletonList(fac.newTransform (Transform.ENVELOPED, (TransformParameterSpec) null)), null, null);

refs.add(ref1);

Reference ref2 = fac.newReference("#" + signedPropID, fac.newDigestMethod(DigestMethod.SHA1,null), null, "http://uri.etsi.org/01903/v1.3.2#SignedProperties", null); // signedPropID = "SignedProps0";

refs.add(ref2);

.......

XMLSignature signature = fac.newXMLSignature (si, ki, objects, signatureID, "SignValID");

signature.sign(dsc); // Exception raises here

throws this exception:

javax.xml.crypto.dsig.XMLSignatureException: javax.xml.crypto.URIReferenceException: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannot resolve element with ID SignedProps0

    at org.jcp.xml.dsig.internal.dom.DOMReference.dereference(Unknown Source)

    at org.jcp.xml.dsig.internal.dom.DOMReference.digest(Unknown Source)

    at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.digestReference(Unknown Source)

    at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(Unknown Source)

    at org.btrust.xades.XadesSigner.initSignXML(XadesSigner.java:516)

Caused by: javax.xml.crypto.URIReferenceException: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannot resolve element with ID SignedProps0

    at org.jcp.xml.dsig.internal.dom.DOMURIDereferencer.dereference(Unknown Source)

    ... 45 more

What is changed in the last java update (Java 7u25) that makes the code not working?

Best Regards, Valentin

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 1 2013
Added on Jul 1 2013
5 comments
6,497 views