频道直达 - 专题 - 新闻 - 技巧 - 组网 - 开发 - 安全 - web编程 - 图像 - 操作系统 - 数据库 - 教育 - 旅游 - 健康 - 时尚 - 驱动 - 软件 - 游戏 - 多媒体 - ERP - 讨论组

利用WSE 加密SOAP报文(8)

来源: 作者: 出处:巧巧读书 2006-09-18 进入讨论组

  下面是被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元素解密过的私有密钥。请保留地址 http://www.qqread.com/xml-soap/k234503.html 更多文章 更多内容请看加密与解密技术常用软件加密宝典专题,或进入讨论组讨论。
收藏此文】【 】【打印】【关闭
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
巧巧读书宗旨
相关专题
最新论坛文章
站内各频道最新更新文档
站内最新制作专题
热门关键字导读
Photoshop教 程照片处理 照片制作 PS快捷键 抠图
计 算 机 故 障XP系统修复
艺 术 与 设 计设计 流媒体 设计欣赏 边框
计 算 机 安 全ARP
站内频道文章精选
巧巧电脑频道编辑信箱  告诉我们您想看的专题或文章