Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

With algorithm using for creating digest value in metro #45

Open
Shkarbatov opened this issue Oct 23, 2018 · 0 comments
Open

With algorithm using for creating digest value in metro #45

Shkarbatov opened this issue Oct 23, 2018 · 0 comments

Comments

@Shkarbatov
Copy link

Shkarbatov commented Oct 23, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant