2
Has anyone experienced this? Error assigning content in the signature tag: Signature -> Reference -> URI
When assigning content in the Reference URI Signature tag I am receiving a EXCEPTION, see below:
javax.xml.crypto.dsig.XMLSignatureException: javax.xml.crypto.URIReferenceException: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannout resolve element with ID IDnnnnnnnnnn
In some literatures / forum, quote, I have done, the implementation of the code:
...
String id = el.getAttribute("id");
el.setIdAttribute("id", true);
...
Reference ref = fac.newReference("#".concat(id), fac.newDigestMethod("http://www.w3.org/2001/04/xmlenc#sha256", null),transformList, null, null);
...
The "id" is exactly like this in the input XML. The content of the ID in Reference is being generated correctly, but when you run the message below, I get this Exception. ( Cannout resolves element with ID Idnnnnnnnnnnnn )
signature.sign(dsc);
The message says "Cannout" or says "Cannot"?
– Victor Stafusa
Osvaldomenezes, take a look at this link and see if this is your case: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8017265
– Pedro Gaspar