XML signature using the Java XML Digital Signature API
843811Dec 25 2009 — edited Jan 5 2010Hi,
I am working on a signature application for a specific use. in my case, i am signing multiple document in the same signature context, so i am using multiple references. the first one is the main document and is an XML document on which i apply an XSLT transformation before the signing it. the other references are attachement (like image files or pdf document ....).
I want to display the content being signed to the signer. on the sun's website, i found how to activate the reference caching so i can get the input stream being signed after the signature has been made.
Now the problem: when i activate the reference caching
" signContext.setProperty("javax.xml.crypto.dsig.cacheReference", Boolean.TRUE); "
i get an ArrayIndexOutOfBoundException threw by this line:
" signature.sign(signContext); "
BUT, everything goes well if i have only one reference to sign (the main one which is an XML document), or the attachemnt size doesn't exceed 12ko or so.
Anybody had already faced such a problem?