.NET で開発された Web サービスと通信しようとしており、PHP でクライアントを作成しています。現在の頭痛の種の 1 つは、SignatureValue と SignedInfo の生成です。
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
<Reference URI="#_0">
<Transforms>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>CwMGnFZklO7XsDfFguzl0tw7iHM=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>nXJEN8p1nupMA/00TK03VZlADkU=</SignatureValue>
サーバーにエントロピーが送信され、サーバーからエントロピーが受信されました... サーバーに送信されました:
<t:Entropy>
<t:BinarySecret u:Id="uuid-6d32fbfc-2a74-422f-8b0b-3089db58f6ec-1"
Type="http://schemas.xmlsoap.org/ws/2005/02/trust/Nonce">
grrlUUfhuNwlvQzQ4bV6TT3wA8ieZPltIf4+H7nIvCE=
</t:BinarySecret>
</t:Entropy>
サーバーから受信:
<t:Entropy>
<t:BinarySecret u:Id="uuid-8aebe294-15d0-4233-a3b1-ddd9a0d43d98-4"
Type="http://schemas.xmlsoap.org/ws/2005/02/trust/Nonce">
YLABh3ZmZyiO5gvVLZe9J4JPd9w59KGeTFwE85XlzxE=
</t:BinarySecret>
</t:Entropy>
私が読んだことから、PSHA1 を使用して共有キーを生成し、conocalized SignedInfo で HMAC_SHA1 を実行して署名付きの値を生成するとします。nXJEN8p1nupMA/00TK03VZlADkU=
これら 2 つのエントロピーを使用すると、期待値は
psha1_derive への私のパラメーターはpsha1_derive($entropySentByMe (as $secret), 'WS-SecureConversationWS-SecureConversation', $entropyReturnedByServer (as $seed), '' (as timestamp), and length is 32 (256 bits));
PSHA1 を使用して共有鍵を取得する方法、または署名値を生成する方法について詳しい情報をお持ちの方がいらっしゃいましたら、お知らせください。