Here is an example....you need to pass the digest method through to sig.addDocument:
http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureTest.java?r1=1789180&r2=1789179&pathrev=1789180 Colm. On Tue, Mar 28, 2017 at 6:27 PM, Fabio Mauri <[email protected]> wrote: > Hi there, > I'm writing an application that needs to send signed XML files to a > service that declares to support only SHA-256 digest: > http://www.w3.org/2001/04/xmlenc#sha256 > > I tried both stable versions 1.5.8 and 2.0.8 of the library, > but I wasn't able to select the right hash method. > It seems that the only supported hash is SHA-1: > http://www.w3.org/2000/09/xmldsig#sha1 > > On the other hand I can successfully select the signature algorythm > SHA-256: > http://www.w3.org/2001/04/xmldsig-more#rsa-sha256 > > Is there someone who can help with some suggestions? > Am I doing something wrong? > > Thanks in advance, > Fabio > -- Colm O hEigeartaigh Talend Community Coder http://coders.talend.com
