SOAP请求 - 为签名消化的是什么?

时间:2017-09-18 08:55:48

标签: soap

一个快速的问题困扰我好几个月了..

当发送SOAP请求(使用或不使用SoapUI)并使用私钥对其进行签名时。为签名消化的是什么?

在我为sha1消化所采取的请求中引用对象的哪一部分,我获得的值与SoapUI生成的值不同。尝试谷歌搜索,但找不到一个体面的文章清楚地解释ref'ed对象的哪个部分被消化签名。

pc-04 ~ $ nc -l 0.0.0.0 5588
POST / HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:[_renamed_]:v1/sendMessage"
Content-Length: 2418
Host: localhost:5588
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:[_renamed_]:schema:v1">
   <soapenv:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><ds:Signature Id="SIG-927771137712DBCACC150572539981324" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="soapenv urn" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#id-927771137712DBCACC150572539981023"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="urn" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>40g3y73kx2NLAk+RtE7A6XYQfq0=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>RNusKNwPvnzII/DZo2nkK8i/xDkq5bSjoZ+vW+BBv7jwoatosim7wjm5JiZGHjfGo1wnJNTA1nTn
/U6sjQZZvtNSuDKHcaY5FphluMYkn5fKSt8JvDsqH+dgNr3w6GMFshDimoIjG3/Opt0rUw7Mgi/x
cUYx95VqYPX20/SQ5MY=</ds:SignatureValue><ds:KeyInfo Id="KI-927771137712DBCACC150572539981021"><wsse:SecurityTokenReference wsu:Id="STR-927771137712DBCACC150572539981022"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>1.2.840.113549.1.9.1=#161c72696361726461732e62756369756e6173406e6f7274616c2e636f6d,CN=[_renamed_],O=[_renamed_] UAB,L=[_renamed_],ST=[_renamed_],C=LT</ds:X509IssuerName><ds:X509SerialNumber>10598525849934796037</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security>
      <urn:requestHeader>
         <!--Optional:-->
         <headtag1>
            <inbox>?</inbox>
         </headtag1>
      </urn:requestHeader>
   </soapenv:Header>
   <soapenv:Body wsu:Id="id-927771137712DBCACC150572539981023" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <urn:message>
         <name>Andrew</name>
         <lname>Hopkins</lname>
         <username>andhop335</username>
      </urn:message>
   </soapenv:Body>
</soapenv:Envelope>pc-04 ~ $ 
pc-04 ~ $

SoapUI如何获得摘要?

pc-045 ~ $ echo 40g3y73kx2NLAk+RtE7A6XYQfq0= | base64 -d | xxd -p
e34837cbbde4c7634b024f91b44ec0e976107ead

0 个答案:

没有答案