javaee / metro

Metro has been contributed to Eclipse Foundation. Please use the link below to find the latest project
https://github.com/eclipse-ee4j/metro-jax-ws
Other
10 stars 1 forks source link

With algorithm using for creating digest value in metro #45

Open Shkarbatov opened 6 years ago

Shkarbatov commented 6 years ago

I have service with SOAP authentication, one of my client use php at their side, but we can't understand, how to create DigestValue.

We trying next:

// Before make hash using canonicalize http://php.net/manual/en/domnode.c14n.php
$data = '<wsu:Timestamp wsu:Id="TS-1"><wsu:Created>2018-10-23T06:20:36.133Z</wsu:Created><wsu:Expires>2018-10-23T06:37:16.133Z</wsu:Expires></wsu:Timestamp>';
base64_encode(hash('sha1', $data, true));

But receive wrong digest value: +qaxdSqNQ29JGMeHvoTQqg7lxww=


This is correct DigestValue from another java client:

<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>B06W6ZeLb4X7bBUuqJ8ke2uA/hw=</ds:DigestValue>

<wsu:Timestamp wsu:Id="TS-1"><wsu:Created>2018-10-23T06:20:36.133Z</wsu:Created><wsu:Expires>2018-10-23T06:37:16.133Z</wsu:Expires></wsu:Timestamp>

Help me please with algorithm, can't find any information.