How to select SHA-256 hash?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to select SHA-256 hash?

Fabio Mauri
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
Reply | Threaded
Open this post in threaded view
|

Re: How to select SHA-256 hash?

Colm O hEigeartaigh-2
Colm.

On Tue, Mar 28, 2017 at 6:27 PM, Fabio Mauri <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: How to select SHA-256 hash?

Fabio Mauri
Thanks a lot Colm!
This actually allowed me to select the right method.

Bye
Fabio

On Tue, Mar 28, 2017 at 7:46 PM, Colm O hEigeartaigh
<[hidden email]> wrote:

> 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 <[hidden email]> 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



--
Fabio Mauri