EJP wrote:That's not actually correct. You can sign non-XML data with an XML Signature using the javax.xml.crypto API. You can sign the binary content fetched from an http or a file URI or write your own URIDereferencer to do the same.
You can't sign anything except an XML file with an XML digital signature, at least not with the standard Java API.
If you need more memory to convert to XML, get more memory, or smaller files, or run the conversion in a separate JVM.
920429 wrote:Assume your binary data is stored in a file, simply create a reference with a file URI pointing to that file:
it is possible parse xml string and xml document and sign
Document doc = dbf.newDocumentBuilder().parse(new InputSource(new StringReader(xmlStream)));
DOMSignContext dsc = new DOMSignContext((PrivateKey)kp, doc.getDocumentElement());
XMLSignature signature = fac.newXMLSignature(si, ki);
so , how i can sing binary document , can you send an example ?