利用WSE 加密SOAP报文(8)
来源:互联网 发布:阿里软件外贸版 编辑:程序博客网 时间:2024/06/06 12:55
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<?xml version="1.0" encoding="utf-8"?>
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlSOAP.org/SOAP/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP:Header>
<wsu:Timestamp
xmlns:wsu="http://schemas.xmlSOAP.org/ws/2002/07/utility">
<wsu:Created>2003-02-11T20:21:52Z</wsu:Created>
<wsu:Expires>2003-02-11T20:26:52Z</wsu:Expires>
</wsu:Timestamp>
<wsse:Security SOAP:mustUnderstand="1"
xmlns:wsse="http://schemas.xmlSOAP.org/ws/2002/07/secext">
<xenc:EncryptedKey
Type="http://www.w3.org/2001/04/xmlenc#EncryptedKey"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference>
<wsse:KeyIdentifier ValueType="wsse:X509v3">
YmlKVwXYD8vuGuYliuIOXOY7ZYN9PwHbfAhCiYOV0aYdEAQQPw=
</wsse:KeyIdentifier>
</wsse:SecurityTokenReference>
</KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>
UyKGBEXdY8lYSzqgdgxOXOY7ZYN9PwHbfAhCiYOV0...bwRnWk=
</xenc:CipherValue>
</xenc:CipherData>
<xenc:ReferenceList>
<xenc:DataReference URI=
"#EncryptedContent-cf014249-0e2a-4f8b-9002-13a7de916be0" />
</xenc:ReferenceList>
</xenc:EncryptedKey>
<xenc:EncryptedKey
Type="http://www.w3.org/2001/04/xmlenc#EncryptedKey"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference>
<wsse:KeyIdentifier ValueType="wsse:X509v3">
YmlKVwXYD8vuGuYliuIYdEAQQPw=
</wsse:KeyIdentifier>
</wsse:SecurityTokenReference>
</KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>
In8Kf1cIdiJJJXCLZ+... wMqBEevXmzk=
</xenc:CipherValue>
</xenc:CipherData>
<xenc:ReferenceList>
<xenc:DataReference URI=
"#EncryptedContent-0744279a-02bf-4ad1-998e-622208eded0e" />
</xenc:ReferenceList>
</xenc:EncryptedKey>
</wsse:Security>
</SOAP:Header>
<SOAP:Body>
<GetXmlDocumentResponse xmlns="http://example.com/dime/">
<GetXmlDocumentResult>
<Response>
<NotEncrypted>
This part of the response does not need encryption
</NotEncrypted>
<EncryptedResponse
wsu:Id="Id:e5e8d792-abe7-4476-91d0-856fbdf4a958"
xmlns:wsu="http://schemas.xmlSOAP.org/ws/2002/07/utility">
<xenc:EncryptedData
Id=
"EncryptedContent-cf014249-0e2a-4f8b-9002-13a7de916be0"
Type="http://www.w3.org/2001/04/xmlenc#Content"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<xenc:EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
<xenc:CipherData>
<xenc:CipherValue>
2MNHCkGVH/5jb0pF4pCh3u2VaUKsWSA...AfEvJZT=
</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</EncryptedResponse>
</Response>
</GetXmlDocumentResult>
</GetXmlDocumentResponse>
</SOAP:Body>
</SOAP:Envelope>
注意,在这个加密后的报文里,这里有一个用于表示X.509证书的BinarySecurityToken元素,但有两个分开的EncryptedKey元素,每个EncryptedData元素都被添加到SOAPContext,在最外面的被加密的元素中(EncryptedResponse),你只能看到EncryptedData元素,当EncryptedResponse被加密后,表示EncryptedSub元素的EncryptedData元素也随之转换为密文了。当这个报文在客户端被收到时,SecurityInputFilter使用来自记号的信息来得到曾给两个EncryptedKey元素解密过的私有密钥。
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
下面是被WSE在运行时序列化后产生的报文加密后的结果 <?xml version="1.0" encoding="utf-8"?>
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlSOAP.org/SOAP/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP:Header>
<wsu:Timestamp
xmlns:wsu="http://schemas.xmlSOAP.org/ws/2002/07/utility">
<wsu:Created>2003-02-11T20:21:52Z</wsu:Created>
<wsu:Expires>2003-02-11T20:26:52Z</wsu:Expires>
</wsu:Timestamp>
<wsse:Security SOAP:mustUnderstand="1"
xmlns:wsse="http://schemas.xmlSOAP.org/ws/2002/07/secext">
<xenc:EncryptedKey
Type="http://www.w3.org/2001/04/xmlenc#EncryptedKey"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference>
<wsse:KeyIdentifier ValueType="wsse:X509v3">
YmlKVwXYD8vuGuYliuIOXOY7ZYN9PwHbfAhCiYOV0aYdEAQQPw=
</wsse:KeyIdentifier>
</wsse:SecurityTokenReference>
</KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>
UyKGBEXdY8lYSzqgdgxOXOY7ZYN9PwHbfAhCiYOV0...bwRnWk=
</xenc:CipherValue>
</xenc:CipherData>
<xenc:ReferenceList>
<xenc:DataReference URI=
"#EncryptedContent-cf014249-0e2a-4f8b-9002-13a7de916be0" />
</xenc:ReferenceList>
</xenc:EncryptedKey>
<xenc:EncryptedKey
Type="http://www.w3.org/2001/04/xmlenc#EncryptedKey"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference>
<wsse:KeyIdentifier ValueType="wsse:X509v3">
YmlKVwXYD8vuGuYliuIYdEAQQPw=
</wsse:KeyIdentifier>
</wsse:SecurityTokenReference>
</KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>
In8Kf1cIdiJJJXCLZ+... wMqBEevXmzk=
</xenc:CipherValue>
</xenc:CipherData>
<xenc:ReferenceList>
<xenc:DataReference URI=
"#EncryptedContent-0744279a-02bf-4ad1-998e-622208eded0e" />
</xenc:ReferenceList>
</xenc:EncryptedKey>
</wsse:Security>
</SOAP:Header>
<SOAP:Body>
<GetXmlDocumentResponse xmlns="http://example.com/dime/">
<GetXmlDocumentResult>
<Response>
<NotEncrypted>
This part of the response does not need encryption
</NotEncrypted>
<EncryptedResponse
wsu:Id="Id:e5e8d792-abe7-4476-91d0-856fbdf4a958"
xmlns:wsu="http://schemas.xmlSOAP.org/ws/2002/07/utility">
<xenc:EncryptedData
Id=
"EncryptedContent-cf014249-0e2a-4f8b-9002-13a7de916be0"
Type="http://www.w3.org/2001/04/xmlenc#Content"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<xenc:EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
<xenc:CipherData>
<xenc:CipherValue>
2MNHCkGVH/5jb0pF4pCh3u2VaUKsWSA...AfEvJZT=
</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</EncryptedResponse>
</Response>
</GetXmlDocumentResult>
</GetXmlDocumentResponse>
</SOAP:Body>
</SOAP:Envelope>
注意,在这个加密后的报文里,这里有一个用于表示X.509证书的BinarySecurityToken元素,但有两个分开的EncryptedKey元素,每个EncryptedData元素都被添加到SOAPContext,在最外面的被加密的元素中(EncryptedResponse),你只能看到EncryptedData元素,当EncryptedResponse被加密后,表示EncryptedSub元素的EncryptedData元素也随之转换为密文了。当这个报文在客户端被收到时,SecurityInputFilter使用来自记号的信息来得到曾给两个EncryptedKey元素解密过的私有密钥。
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- 利用WSE 加密SOAP报文(8)
- 利用WSE 加密SOAP报文(8)
- 利用WSE 加密SOAP报文(1)
- 利用WSE 加密SOAP报文(2)
- 利用WSE 加密SOAP报文(3)
- 利用WSE 加密SOAP报文(4)
- 利用WSE 加密SOAP报文(5)
- 利用WSE 加密SOAP报文(6)
- 利用WSE 加密SOAP报文(7)
- 利用WSE 加密SOAP报文(1)
- 利用WSE 加密SOAP报文(2)
- 利用WSE 加密SOAP报文(7)
- 利用WSE 加密SOAP报文(5)
- 利用WSE 加密SOAP报文增加WEB SERVICE 的安全性
- 利用WSE 加密SOAP报文增加WEB SERVICE 的安全性
- 利用WSE 加密SOAP报文增加WEB SERVICE 的安全性 选择自 Eastunfail 的 Blog
- 使用WSE实现对SOAP报文进行加密
- soap报文格式
- 用PHP发送MIME邮件(一)
- CLR 调试接口的架构与应用 [2] 调试框架
- PHP的面向对象编程:开发大型PHP项目的方法(四)
- C#教程第七课:类的入门
- PHP的面向对象编程:开发大型PHP项目的方法(二)
- 利用WSE 加密SOAP报文(8)
- PHP的面向对象编程:开发大型PHP项目的方法(三)
- 一对多关联的数据库在VB.NET中如何新增记录
- PHP的面向对象编程:开发大型PHP项目的方法(一)
- 使用Ado.net获取数据库架构信息
- 谈网页编程PHP语言的发展
- ACCESS2000数据库文件密码的提取(源程序c++builder5)(推荐大家转换成C#版本)
- PHP 4.4.0发布 修复导致内存崩溃问题
- 一个C++及Delphi做的压缩程序