Bug 60540

Summary: Cannot resolve element with ID idSignedProperties
Product: POI Reporter: Lucio Rodriguez <lrvaliente>
Component: POIFSAssignee: POI Developers List <dev>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P2    
Version: 3.15-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Lucio Rodriguez 2017-01-02 14:49:18 UTC
I have an issue with the digital signer. I tried add digital sign to Microsoft Office Document, I attach the Exception:

javax.xml.crypto.URIReferenceException: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannot resolve element with ID idSignedProperties
	at org.jcp.xml.dsig.internal.dom.DOMURIDereferencer.dereference(DOMURIDereferencer.java:121)
	at org.apache.poi.poifs.crypt.dsig.OOXMLURIDereferencer.dereference(OOXMLURIDereferencer.java:85)
	at org.jcp.xml.dsig.internal.dom.DOMReference.dereference(DOMReference.java:430)
	at org.jcp.xml.dsig.internal.dom.DOMReference.digest(DOMReference.java:364)
	at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.digestReference(DOMXMLSignature.java:496)
	at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(DOMXMLSignature.java:379)
	at org.apache.poi.poifs.crypt.dsig.SignatureInfo.preSign(SignatureInfo.java:522)
	at org.apache.poi.poifs.crypt.dsig.SignatureInfo.confirmSignature(SignatureInfo.java:335)
	at py.gov.senatics.SignerOfficeHelper.signOfficeXML(SignerOfficeHelper.java:221)
	at py.gov.senatics.SignerOfficeHelper$1.run(SignerOfficeHelper.java:115)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:332)
	at py.gov.senatics.SignerOfficeHelper.pressFirmarOnLinux(SignerOfficeHelper.java:92)
	at py.gov.senatics.SenaticsFirma.signDocument(SenaticsFirma.java:667)
	at py.gov.senatics.SenaticsFirma$2$1.run(SenaticsFirma.java:367)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannot resolve element with ID idSignedProperties
	at com.sun.org.apache.xml.internal.security.utils.resolver.implementations.ResolverFragment.engineResolveURI(ResolverFragment.java:89)
	at com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver.resolve(ResourceResolver.java:313)
	at com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver.resolve(ResourceResolver.java:298)
	at org.jcp.xml.dsig.internal.dom.DOMURIDereferencer.dereference(DOMURIDereferencer.java:114)
	... 15 more

I copied the code publiced in your site and I think I applied correctly I attached your site URL: http://poi.apache.org/encryption.html#Signing+an+office+document, but don't work for me. Could you tell me about this error?. What could be the fix?

I'm very grateful if you could give me a solution
Comment 1 Dominik Stadler 2017-01-02 19:15:42 UTC
Can you provide a sample file with password that allows to reproduce this?
Comment 2 Andreas Beeker 2017-01-02 21:16:10 UTC
So lets imagine, how we would try to resolve that issue:
1. we need a document
2. we would try to sign it with a self-signed certificate

if in that process, the error happens again, then we could fix it ... otherwise we would resolve the issue as "works for me"

To debug that error yourself, you could check what "uri" is dereference at OOXMLURIDereferencer.java:85 ... maybe it's an external uri?
Comment 3 Dominik Stadler 2019-04-23 20:41:11 UTC
No more information received, so closing this wontfix for now.