【IT168技术文档】
一个加密后的SOAP 报文
下面的SOAP报文示例有一个payment节点,含有一些敏感的客户信息.
因为payment节点含有敏感的数据,所以它应该被加密.下面的例子显示了相同的信息,但是payment节点被EncryptedData节点代替了.EncryptedData节点内含有对payment 节点内部内容加密后的密文. EncryptedData节点是参考自security头中的DataReference 节点的OAP:Envelope SOAP:xmlsn="http://www.w3.org/2002/12/SOAP-envelope"> <SOAP:Header> ... </SOAP:Header> <SOAP:Body> ... <x:Order Type="Purchase" x:xmlns="http://example.com/order"> <x:Payment Type="CreditCard"> <x:CreditCard Type="Visa"> <x:CardNumber>123456789123456</CardNumber> <x:ExperationDate>1108</ExperationDate> </x:CreditCard> </x:Payment> ... </x:Order> ... </SOAP:Body> </SOAP:Envelope>
<SOAP:Envelope SOAP:xmlsn="http://www.w3.org/2002/12/SOAP-envelope" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:xsig="http://www.w3.org/2000/09/xmldsig#" xmlns:WSse="http://schemas.xmlSOAP.org/WS/2002/04/secext"> <SOAP:Header> <WSse:Security> <xenc:ReferenceList> <xenc:DataReference URI="#OrderID"/> </xenc:ReferenceList> </WSse:Security> ... </SOAP:Header> <SOAP:Body> ... <x:Order Type="Purchase" x:xmlns="http://example.com/order"> <xenc:EncryptedData Id="OrderId"> <xenc:EncryptionMethod Algorithm= "http://www.w3.org/2001/04/xmlenc#tripledes-cbc" <xsig:KeyInfo> <xsig:KeyName>My Symmetric Key</xsig:KeyName> </xsig:KeyInfo> <xenc:CipherData> <xenc:CipherValue>...</CipherValue> </xenc:CipherData> </xenc:EncryptedData> ... </x:Order> ... </SOAP:Body> </SOAP:Envelope>