文章目录
- [第五十章 安全元素的详细信息](#第五十章 安全元素的详细信息)
- `<BinarySecurityToken>`
- 详细
- 消息中的位置
- `<EncryptedKey>`
第五十章 安全元素的详细信息
本主题讨论 SOAP
消息中较常见的安全元素,特别是 IRIS Web
服务和客户端可以发送的变体。此信息旨在帮助那些不经常使用 SOAP
的人重温记忆。此处的详细信息也可能有助于故障排除。
<BinarySecurityToken>
<BinarySecurityToken>
的目的是携带消息中其他元素使用的安全凭证,供消息接收者使用。安全凭证以序列化、编码的形式携带。以下显示了部分示例:
xml
<BinarySecurityToken wsu:Id="SecurityToken-4EC1997A-AD6B-48E3-9E91-8D50C8EA3B53"
EncodingType="[parts omitted]#Base64Binary"
ValueType="[parts omitted]#X509v3">
MIICnDCCAYQ[parts omitted]ngHKNhh
</BinarySecurityToken>
详细
该元素的各部分如下:
Id
是此令牌的唯一标识符,包含该标识符以便此消息中的其他元素可以引用此令牌。如有必要,IRIS
会自动生成此标识符。EncodingType
表示用于生成 <BinarySecurityToken>
中的值的编码类型。在IRIS
中,<BinarySecurityToken>
中使用的唯一编码是base-64
编码。ValueType
表示令牌中包含的值的类型。在IRIS
中,唯一支持的值类型是X.509
证书。<BinarySecurityToken>
元素中包含的值是序列化的编码证书。在此示例中,值MIICnDCCAYQ[parts divided]ngHKNhh
是安全凭证。
如果此令牌与加密操作相关联,则所包含的证书是消息接收者的证书。如果此令牌与签名相关联,则所包含的证书是消息发送者的证书。
消息中的位置
<BinarySecurityToken>
应该包含在 <Security>
中,在任何引用它的元素之前。
<EncryptedKey>
<EncryptedKey>
的作用是携带供消息中其他元素使用的对称密钥。对称密钥以加密形式携带。以下显示了部分示例:
xml
<EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="[parts omitted]xmlenc#rsa-oaep-mgf1p">
<DigestMethod xmlns="http://www.w3.org/2000/09/xmldsig#"
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1">
</DigestMethod>
</EncryptionMethod>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<SecurityTokenReference xmlns="[parts omitted]oasis-200401-wss-wssecurity-secext-1.0.xsd">
<Reference URI="#SecurityToken-4EC1997A-AD6B-48E3-9E91-8D50C8EA3B53"
ValueType="[parts omitted]#X509v3">
</Reference>
</SecurityTokenReference>
</KeyInfo>
<CipherData>
<CipherValue>WtE[parts omitted]bSyvg==</CipherValue>
</CipherData>
<ReferenceList>
<DataReference URI="#Enc-143BBBAA-B75D-49EB-86AC-B414D818109F"></DataReference>
</ReferenceList>
</EncryptedKey>