Web 服务安全协议提供 Web 服务安全机制,这些机制可满足所有现有企业的消息传递安全要求。 本部分介绍以下 Web 服务安全协议的 Windows Communication Foundation (WCF) 版本 1.0 详细信息(在 SecurityBindingElement 中实现)。
WCF 版本 1 提供 17 种身份验证模式,这些模式可用作 Web 服务安全配置的基础。 每一种模式都针对一组常用部署需求进行了优化,如:
- 用于对客户端和服务进行身份验证的凭据。
- 消息或传输安全保护机制。
- 消息交换模式。
身份验证模式 | 客户端身份验证 | 服务器身份验证 | 模型 |
---|---|---|---|
UserNameOverTransport | 用户名/密码 | X509 | 运输 |
CertificateOverTransport | X509 | X509 | 运输 |
KerberosOverTransport | Windows操作系统 | X509 | 运输 |
IssuedTokenOverTransport | 联合 | X509 | 运输 |
SspiNegotiatedOverTransport | 协商的 Windows Sspi | 协商的 Windows Sspi | 运输 |
AnonymousForCertificate | 无 | X509 | 消息 |
证书用户名 | 用户名/密码 | X509 | 消息 |
MutualCertificate | X509 | X509 | 消息 |
MutualCertificateDuplex | X509 | X509 | 消息 |
IssuedTokenForCertificate | 联合 | X509 | 消息 |
Kerberos | Windows操作系统 | Windows操作系统 | 消息 |
IssuedToken | 联合 | 联合 | 消息 |
SspiNegotiated | 协商的 Windows Sspi | 协商的 Windows Sspi | 消息 |
AnonymousForSslNegotiated | 无 | X509、TLS-Nego | 消息 |
UserNameForSslNegotiated | 用户名/密码 | X509、TLS-Nego | 消息 |
MutualSslNegotiated | X509 | X509、TLS-Nego | 消息 |
IssuedTokenForSslNegotiated | 联合 | X509、TLS-Nego | 消息 |
使用此类身份验证模式的终结点可以使用 WS-SecurityPolicy (WS-SP) 表示其安全要求。 本文档介绍每种身份验证模式的安全标头和基础结构消息的结构,并提供策略和消息的示例。
WCF 利用 WS-SecureConversation 来提供安全会话支持,以保护应用程序之间的多消息交换。 请参见下面的“安全会话”了解实现细节。
除了身份验证模式之外,WCF 还提供一些设置用于控制应用于大多数基于消息安全的身份验证模式的常见保护机制,例如:签名与加密操作的顺序、算法套件、密钥派生和签名确认。
本文档使用以下前缀和命名空间。
前缀 | 命名空间 |
---|---|
s | https://www.w3.org/2003/05/soap-envelope/ |
sp | https://schemas.xmlsoap.org/ws/2005/07/securitypolicy/ |
一个 | https://www.w3.org/2005/08/addressing |
wsse | TBD – OASIS WSS 1.0 URI |
wsse11 | TBD – OASIS WSS 1.1 URI |
wsu | TBD – OASIS WSS 1.0 实用工具 URI |
数据结构 (assuming "ds" stands for "data structures") | TBD – W3C XMLDSig URI |
wst | TBD – WS-Trust 2005/02 URI |
wssc | TBD – WS-SecureConversation 2005/02 URI |
wsaw | TBD - WS-Addressing 策略命名空间 |
wsp | https://schemas.xmlsoap.org/ws/2004/09/policy |
mssp | https://schemas.xmlsoap.org/ws/2005/07/securitypolicy |
1. 令牌配置文件
Web 服务安全规范将凭据表示为安全令牌。 WCF 支持以下令牌类型:
1.1 UsernameToken
WCF 遵循 UsernameToken10 和 UsernameToken11 配置文件,并存在以下约束:
R1101 UsernameToken\Password 元素的 PasswordType 属性必须省略或者值为 #PasswordText(默认值)。
可以使用可扩展性实现 #PasswordDigest。 人们已经发现,#PasswordDigest 经常被误认为是足够安全的密码保护机制。 但实际上,#PasswordDigest 不可取代 UsernameToken 加密。 #PasswordDigest 的主要目的是防止重放攻击。 在 WCF 身份验证模式下,使用消息签名可缓解重放攻击威胁。
B1102 WCF 永不省略 UsernameToken 的 Nonce 和 Created 子元素。
这些子元素旨在帮助重放检测。 WCF 改用消息签名。
OASIS WSS SOAP Message Security UsernameToken Profile 1.1 (UsernameToken11) 引入了从密码派生密钥的功能。
B1103 UsernameToken 密码不得用于密钥派生,因此也不得用于加密操作。
根本原因:密码通常被视为过于脆弱,不适合用于加密操作。
1.2 X509 令牌
WCF 支持使用 X509v3 证书作为凭据类型,遵循 X509TokenProfile1.0 和 X509TokenProfile1.1,并存在以下约束:
R1201 在包含 X509v3 证书时,BinarySecurityToken 元素的 ValueType 属性必须值为 #X509v3。
WSS X509 Token Profile 1.0 和 1.1 还定义了 #X509PKIPathv1 和 #PKCS7 作为值类型。 WCF 不支持这些类型。
R1202 如果 SubjectKeyIdentifier (SKI) 扩展在 X509 证书中存在,wsse:KeyIdentifier 应该用于对该令牌的外部引用,并且 ValueType 属性为 #X509SubjectKeyIdentifier 且其内容为证书的 SKI 扩展的 base64 编码值。
SKI 引用已广泛实现,已证明是高度可互操作的外部引用类型。
R1203 对 X509 安全令牌的外部引用不应使用 ds:X509IssuerSerial。
R1204 如果使用 X509TokenProfile1.1,则对 X509 安全令牌的外部引用应该使用 WS-Security 1.1 引入的指纹。
WCF 支持 X509IssuerSerial。 但是,X509IssuerSerial 存在互操作性问题:WCF 使用一个字符串来比较 X509IssuerSerial 的两个值。 因此,如果有人重新排序了“主题名称”的各个组成部分,并向 WCF 服务发送对证书的引用,则可能找不到该引用。
1.3 Kerberos 令牌
WCF 支持将 KerberosTokenProfile1.1 用于 Windows 身份验证,并存在以下约束:
R1301 Kerberos 令牌必须携带 GSS_API 和 Kerberos 规范中定义的 GSS 包装的 Kerberos v4 AP_REQ 的值,并且必须有值为 #GSS_Kerberosv5_AP_REQ 的 ValueType 属性。
WCF 使用 GSS 包装的 Kerberos AP-REQ,而不是裸 AP-REQ。 这是一种安全最佳做法。
1.4 SAML v1.1 令牌
WCF 支持适用于 SAML v1.1 令牌的 WSS SAML 令牌配置文件 1.0 和 1.1。 可以实现其他版本的 SAML 令牌格式。
1.5 安全上下文令牌
WCF 支持 WS-SecureConversation 中引入的安全上下文令牌 (SCT)。 SCT 用于表示在 SecureConversation 中建立的安全上下文以及下面所述的二进制协商协议 TLS 和 SSPI。
2. 常用消息安全参数
2.1 时间戳
时间戳存在与否是使用 IncludeTimestamp 类的 SecurityBindingElement 属性控制的。 WCF 始终序列化带有 wsse:Created 和 wsse:Expires 字段的 wsse:TimeStamp。 使用签名时,总会对 wsse:TimeStamp 进行签名。
2.2 保护顺序
WCF 支持消息保护顺序“加密前签名”和“签名前加密”(安全策略 1.1)。 建议使用“加密前签名”,其原因包括:除非使用 WS-Security 1.1 SignatureConfirmation 机制,否则使用“签名前加密”进行保护的消息易受签名替换攻击,并且对加密内容进行签名使得审核更加困难。
2.3 签名保护
在使用“签名前加密”时,建议保护签名以防止对加密内容或签名密钥进行猜测的蛮力攻击(尤其是在自定义令牌与弱密钥材料一起使用时)。
2.4 算法组
WCF 支持安全策略 1.1 中列出的所有算法套件。
2.5 密钥派生
WCF 使用 WS-SecureConversation 中所述的“对称密钥的密钥派生”。
2.6 签名确认
签名确认可用于防止中间人攻击以保护签名集。
2.7 安全标头布局
每种身份验证模式都描述一种特定的安全标头布局。 安全标头内的元素为半有序。 为了定义安全标头子元素的顺序,WS-Security Policy 定义了以下安全标头布局模式:
布局模式 | 元素顺序 |
---|---|
严格 | 根据“使用前先声明”的一般原则,各项按照 Security Policy 第 7.7.1 节中所述的编号布局规则添加到安全标头中。 |
宽松 | 各项以任何符合“WSS: SOAP 消息安全”的顺序添加到安全标头中。 |
LaxTimestampFirst | 与 Lax 相同,只是安全标头中的第一项必须为 wsse:Timestamp |
LaxTimestampLast | 与 lax 相同,只是安全标头中的最后一项必须为 wsse:Timestamp |
WCF 支持安全标头布局的所有四种模式。 以下针对身份验证模式的安全标头结构和消息示例遵循“Strict”模式。
6. 身份验证模式策略
本节介绍每种身份验证模式的示例策略以及演示客户端和服务所交换的消息中的安全标头结构的示例。
6.1 传输保护
WCF 提供五种使用安全传输来保护消息的身份验证模式:UserNameOverTransport、CertificateOverTransport、KerberosOverTransport、IssuedTokenOverTransport 和 SspiNegotiatedOverTransport。
这些身份验证模式是使用 SecurityPolicy 中描述的传输绑定构造的。 对于 UserNameOverTransport 身份验证模式,UsernameToken 是签名支持令牌。 对于其他身份验证模式,令牌作为签名认可令牌出现。 SecurityPolicy 的附录 C.1.2 和 C.1.3 详细介绍了安全标头布局。 下面的示例安全标头演示给定身份验证模式的 Strict 布局。
任何情况下,令牌的“Derived Keys”属性的值总是为“false”。
传输绑定的各个属性的值如下:
时间戳:true
安全标头布局:Strict
算法组:Basic256
6.1.1 UsernameOverTransport
在此身份验证模式下,客户端使用“用户名令牌”进行身份验证,该令牌作为签名支持令牌(总是从发起方发送到接收方)出现在 SOAP 层上。 在传输层,服务是用 X.509 证书进行身份验证的。 所用绑定为传输绑定。
策略
<wsp:Policy wsu:Id='UsernameOverTransport_policy' >
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding >
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate='false' />
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
</wsp:Policy>
</sp:TransportBinding>
<sp:SignedSupportingTokens >
<wsp:Policy>
<sp:UsernameToken
sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<wsp:Policy>
<sp:WssUsernameToken10 />
</wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SignedSupportingTokens>
<sp:Wss11 >
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
<sp:MustSupportRefThumbprint />
<sp:MustSupportRefEncryptedKey />
</wsp:Policy>
</sp:Wss11>
<sp:Trust10 >
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
安全标头布局
请求
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wsse:UsernameToken>
...
</wsse:UsernameToken>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
</wsse:Security>
6.1.2 CertificateOverTransport
在此身份验证模式下,客户端使用 X.509 证书进行身份验证,该证书作为认可支持令牌(总是从发起方发送到接收方)出现在 SOAP 层上。 在传输层,服务是用 X.509 证书进行身份验证的。 所用绑定为传输绑定。
策略
<wsp:Policy wsu:Id='CertificateOverTransport_policy' >
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding xmlns:sp='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy' >
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate='false' />
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
</wsp:Policy>
</sp:TransportBinding>
<sp:EndorsingSupportingTokens>
<wsp:Policy>
<sp:X509Token
sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<wsp:Policy>
<sp:RequireThumbprintReference />
<sp:WssX509V3Token10 />
</wsp:Policy>
</sp:X509Token>
<sp:SignedParts>
<sp:Header Name='To'
Namespace='http://www.w3.org/2005/08/addressing' />
</sp:SignedParts>
</wsp:Policy>
</sp:EndorsingSupportingTokens>
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
<sp:MustSupportRefThumbprint />
<sp:MustSupportRefEncryptedKey />
</wsp:Policy>
</sp:Wss11>
<sp:Trust10>
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
安全标头布局
请求
<wsse:Security s:mustUnderstand="1">
<wse:Timestamp u:Id="_0">
...
</wse:Timestamp>
<wsse:BinarySecurityToken>
...
</wsse:BinarySecurityToken>
<ds:Signature>
...
</ds:Signature>
</wsse:Security>
响应
<o:Security>
<u:Timestamp u:Id="_0">
...
</u:Timestamp>
</o:Security>
6.1.3 IssuedTokenOverTransport
在此身份验证模式下,客户端不向服务进行身份验证,而是出示一个由安全令牌服务 (STS) 颁发的令牌,并证明掌握了共享密钥。 颁发的令牌作为认可支持令牌(总是从发起方发送到接收方)出现在 SOAP 层上。 在传输层,服务是用 X.509 证书进行身份验证的。 绑定为传输绑定。
策略
<wsp:Policy wsu:Id='IssuedTokenOverTransport_policy' >
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding >
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate='false' />
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
</wsp:Policy>
</sp:TransportBinding>
<sp:EndorsingSupportingTokens>
<wsp:Policy>
<sp:IssuedToken
sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<sp:RequestSecurityTokenTemplate>
<wst:KeyType>
http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey
</wst:KeyType>
</sp:RequestSecurityTokenTemplate>
<wsp:Policy>
<sp:RequireInternalReference />
</wsp:Policy>
</sp:IssuedToken>
<sp:SignedParts>
<sp:Header Name='To'
Namespace='http://www.w3.org/2005/08/addressing' />
</sp:SignedParts>
</wsp:Policy>
</sp:EndorsingSupportingTokens>
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
<sp:MustSupportRefThumbprint />
<sp:MustSupportRefEncryptedKey />
</wsp:Policy>
</sp:Wss11>
<sp:Trust10>
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
安全标头布局
请求
<wsse:Security s:mustUnderstand="1" >
<wsu:Timestamp>
...
</wsu:Timestamp>
<saml:Assertion>
...
</saml:Assertion>
<ds:Signature>
...
</ds:Signature>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
</wsse:Security>
6.1.4 KerberosOverTransport
在此身份验证模式下,客户端使用 Kerberos 票证向服务进行身份验证。 Kerberos 令牌作为认可支持令牌出现在 SOAP 层上。 在传输层,服务是用 X.509 证书进行身份验证的。 绑定为传输绑定。
策略
<wsp:Policy wsu:Id='KerberosOverTransport_policy' >
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding>
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate='false' />
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic128 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
</wsp:Policy>
</sp:TransportBinding>
<sp:EndorsingSupportingTokens>
<wsp:Policy>
<sp:KerberosToken
sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Once' >
<wsp:Policy>
<sp:WssGssKerberosV5ApReqToken11 />
</wsp:Policy>
</sp:KerberosToken>
<sp:SignedParts>
<sp:Header Name='To'
Namespace='http://www.w3.org/2005/08/addressing' />
</sp:SignedParts>
</wsp:Policy>
</sp:EndorsingSupportingTokens>
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
<sp:MustSupportRefThumbprint />
<sp:MustSupportRefEncryptedKey />
</wsp:Policy>
</sp:Wss11>
<sp:Trust10>
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
安全标头布局
请求
<wsse:Security s:mustUnderstand="1" >
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wsse:BinarySecurityToken ValueType="...#GSS_Kerberosv5_AP_REQ">
...
</wsse:BinarySecurityToken>
<ds:Signature>
...
</ds:Signature>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
</wsse:Security>
6.1.5 SspiNegotiatedOverTransport
在此模式下,将使用协商协议来执行客户端和服务器身份验证。 如果可能,就使用 Kerberos,否则使用 NTLM。 产生的 SCT 作为认可支持令牌(总是从发起方发送到接收方)出现在 SOAP 层上。 在传输层,服务还是由 X.509 证书另外进行身份验证。 所用绑定为传输绑定。 “SPNEGO”(协商)描述 WCF 如何将 SSPI 二进制协商协议用于 WS-Trust。 在通过 SPNEGO 握手建立 SCT 之后,本节将介绍安全标头示例。
策略
<wsp:Policy wsu:Id='SspiNegotiatedOverTransport_policy' >
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding>
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate='false' />
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
</wsp:Policy>
</sp:TransportBinding>
<sp:EndorsingSupportingTokens>
<wsp:Policy>
<sp:SpnegoContextToken
sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<wsp:Policy />
</sp:SpnegoContextToken>
<sp:SignedParts>
<sp:Header Name='To'
Namespace='http://www.w3.org/2005/08/addressing' />
</sp:SignedParts>
</wsp:Policy>
</sp:EndorsingSupportingTokens>
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
<sp:MustSupportRefThumbprint />
<sp:MustSupportRefEncryptedKey />
</wsp:Policy>
</sp:Wss11>
<sp:Trust10>
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
安全标头示例
在使用 WS-Trust 二进制协商通过 SPNEGO 握手建立安全上下文令牌之后,应用程序消息将具有如下结构的安全标头。
请求
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wssc:SecurityContextToken u:Id="uuid-2202746a-7725-453d-8747-809cb718dab0-29" >
...
</wssc:SecurityContextToken>
<ds:Signature>
...
</ds:Signature>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
</wsse:Security>
6.2 将 X.509 证书用于服务身份验证
本节介绍以下身份验证模式:MutualCertificate WSS1.0、Mutual CertificateDuplex、MutualCertificate WSS1.1、AnonymousForCertificate、UserNameForCertificate 和 IssuedTokenForCertificate。
6.2.1 MutualCertificate WSS1.0
在此身份验证模式下,客户端使用 X.509 证书进行身份验证,该证书作为发起方令牌出现在 SOAP 层上。 同样使用 X.509 证书对服务进行身份验证。
所用绑定为带有以下属性值的非对称绑定:
发起方令牌:客户端的 X.509 证书,包含模式设置为 …/IncludeToken/AlwaysToRecipient
接收方令牌:服务器的 X.509 证书,包含模式设置为 …/IncludeToken/Never
令牌保护:False
整个标头和正文签名:True
保护顺序:SignBeforeEncrypt
加密签名:True
策略
<wsp:Policy wsu:Id='MutualCertificate_WSS10_policy' >
<wsp:ExactlyOne>
<wsp:All>
<sp:AsymmetricBinding>
<wsp:Policy>
<sp:InitiatorToken>
<wsp:Policy>
<sp:X509Token
sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<wsp:Policy>
<sp:WssX509V3Token10 />
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:InitiatorToken>
<sp:RecipientToken>
<wsp:Policy>
<sp:X509Token
sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never' >
<wsp:Policy>
<sp:WssX509V3Token10 />
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:RecipientToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
<sp:EncryptSignature />
<sp:OnlySignEntireHeadersAndBody />
</wsp:Policy>
</sp:AsymmetricBinding>
<sp:Wss10>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
</wsp:Policy>
</sp:Wss10>
<sp:Trust10>
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wsse:BinarySecurityToken>
...
</wsse:BinarySecurityToken>
<xenc:EncryptedKey>
...
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</xenc:EncryptedKey>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<xenc:EncryptedKey>
...
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</xenc:EncryptedKey>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wsse:BinarySecurityToken>
...
</wsse:BinarySecurityToken>
<xenc:EncryptedKey>
...
</xenc:EncryptedKey>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<xenc:EncryptedKey>
...
</xenc:EncryptedKey>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
6.2.2 MutualCertificateDuplex
在此身份验证模式下,客户端使用 X.509 证书进行身份验证,该证书作为发起方令牌出现在 SOAP 层上。 同样使用 X.509 证书对服务进行身份验证。
所用绑定为带有以下属性值的非对称绑定:
发起方令牌:客户端的 X509 证书,包含模式设置为 …/IncludeToken/AlwaysToRecipient
接收方令牌:服务器的 X509 证书,包含模式设置为 …/IncludeToken/AlwaysToInitiator
令牌保护:False
整个标头和正文签名:True
保护顺序:SignBeforeEncrypt
加密签名:True
策略
<wsp:Policy wsu:Id='MutualCertificateDuplex_policy' >
<wsp:ExactlyOne>
<wsp:All>
<sp:AsymmetricBinding>
<wsp:Policy>
<sp:InitiatorToken>
<wsp:Policy>
<sp:X509Token
sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<wsp:Policy>
<sp:WssX509V3Token10 />
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:InitiatorToken>
<sp:RecipientToken>
<wsp:Policy>
<sp:X509Token
sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToInitiator' >
<wsp:Policy>
<sp:WssX509V3Token10 />
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:RecipientToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
<sp:EncryptSignature />
<sp:OnlySignEntireHeadersAndBody />
</wsp:Policy>
</sp:AsymmetricBinding>
<sp:Wss10>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
</wsp:Policy>
</sp:Wss10>
<sp:Trust10>
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求和响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wsse:BinarySecurityToken>
...
</wsse:BinarySecurityToken>
<xenc:EncryptedKey>
...
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</xenc:EncryptedKey>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求和响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wsse:BinarySecurityToken>
...
</wsse:BinarySecurityToken>
<xenc:EncryptedKey>
...
</xenc:EncryptedKey>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
6.2.3 将 SymmetricBinding 用于 X.509 服务身份验证
“WSS10”对 X509 令牌方案提供有限支持。 例如,如果消息仅使用服务 X509 令牌,则无法为其提供签名和加密保护。 “WSS11”将 EncryptedKey 用作对称令牌。 现在,为服务的 X.509 证书加密的临时密钥可同时用于请求和响应消息保护。 下面第 6.4 节中介绍的身份验证模式使用此模式。
WS-SecurityPolicy 描述了此模式,即将 SymmetricBinding 用于服务 X509 令牌作为保护令牌。
身份验证模式 AnonymousForCertificate、UsernameForCertificate、MutualCertificate WSS11 和 IssuedTokenForCertificate 都使用具有以下属性值的类似的 sp:SymmetricBinding 实例:
保护令牌:服务器的 X509 证书,包含模式设置为 .../IncludeToken/Never 令牌保护:False
整个标头和正文签名:True
保护顺序:SignBeforeEncrypt
加密签名:True
上述身份验证模式的区别仅在于它们所使用的支持令牌。 AnonymousForCertificate 没有任何支持令牌,MutualCertificate WSS 1.1 将客户端的 X509 证书作为认可支持令牌,UserNameForCertificate 将“用户名令牌”作为签名支持令牌,而 IssuedTokenForCertificate 将颁发的令牌作为认可支持令牌。
策略
对称绑定
<wsp:Policy wsu:Id='SymmetricCert_policy' >
<wsp:ExactlyOne>
<wsp:All>
<sp:SymmetricBinding>
<wsp:Policy>
<sp:ProtectionToken>
<wsp:Policy>
<sp:X509Token
sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never' >
<wsp:Policy>
<sp:RequireDerivedKeys />
<sp:RequireThumbprintReference />
<sp:WssX509V3Token10 />
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:ProtectionToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
<sp:EncryptSignature />
<sp:OnlySignEntireHeadersAndBody />
</wsp:Policy>
</sp:SymmetricBinding>
<!-- Supporting Token Assertions appear here -->
...
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
<sp:MustSupportRefThumbprint />
<sp:MustSupportRefEncryptedKey />
<sp:RequireSignatureConfirmation />
</wsp:Policy>
</sp:Wss11>
<sp:Trust10>
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
6.2.4 AnonymousForCertificate
在此身份验证模式下,客户端是匿名的,而使用 X.509 证书对服务进行身份验证。 所用绑定为 6.4.2 中所述的对称绑定的实例。
策略
请参见上面 6.2.3 中的“策略”以了解绑定详细信息
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<xenc:EncryptedKey>
...
</xenc:EncryptedKey>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<xenc:EncryptedKey>
...
</xenc:EncryptedKey>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wsse11:SignatureConfirmation />
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
6.2.5 UserNameForCertificate
在此身份验证模式下,客户端使用“用户名令牌”向服务进行身份验证,该令牌作为签名支持令牌出现在 SOAP 层上。 服务使用 X.509 证书对客户端进行身份验证。 所用绑定为对称绑定,其保护令牌是由客户端生成的密钥,用服务的公钥进行加密。
策略
请参见上面 6.2.3 中的“策略”以了解绑定详细信息
签名支持令牌
<sp:SignedSupportingTokens>
<wsp:Policy>
<sp:UsernameToken sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<wsp:Policy>
<sp:WssUsernameToken10 />
</wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SignedSupportingTokens>
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<xenc:EncryptedKey>
...
</xenc:EncryptedKey>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<xenc:EncryptedKey>
...
</xenc:EncryptedKey>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
6.2.6 MutualCertificate (WSS 1.1)
在此身份验证模式下,客户端使用 X.509 证书进行身份验证,该证书作为认可支持令牌出现在 SOAP 层上。 同样使用 X.509 证书对服务进行身份验证。 所用绑定为对称绑定,其保护令牌是由客户端生成的密钥,用服务的公钥进行加密。
策略
请参见 6.2.3 中的“策略”以了解绑定详细信息
认可支持令牌
<sp:EndorsingSupportingTokens>
<wsp:Policy>
<sp:X509Token sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<wsp:Policy>
<sp:RequireThumbprintReference />
<sp:WssX509V3Token10 />
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:EndorsingSupportingTokens>
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<xenc:EncryptedKey>
...
</xenc:EncryptedKey>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<wsse:BinarySecurityToken>
...
</wsse:BinarySecurityToken>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<wsse:BinarySecurityToken>
...
</wsse:BinarySecurityToken>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<xenc:EncryptedKey>
...
</xenc:EncryptedKey>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wsse:BinarySecurityToken>
...
</wsse:BinarySecurityToken>
<ds:Signature>
...
</ds:Signature>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<xenc:EncryptedKey>
...
</xenc:EncryptedKey>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wsse11:SignatureConfirmation />
<wsse11:SignatureConfirmation />
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
6.2.7 IssuedTokenForCertificate
在此身份验证模式下,客户端不向服务进行身份验证,而是出示一个由 STS 颁发的令牌,并证明掌握了共享密钥。 颁发的令牌作为认可支持令牌出现在 SOAP 层上。 服务使用 X.509 证书对客户端进行身份验证。 所用绑定为对称绑定,其保护令牌是由客户端生成的密钥,用服务的公钥进行加密。
策略
请参见上面的 6.2.3 以了解绑定详细信息。
认可支持令牌
<sp:EndorsingSupportingTokens>
<wsp:Policy>
<sp:IssuedToken sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<sp:RequestSecurityTokenTemplate>
<wst:KeyType>
http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey
</wst:KeyType>
</sp:RequestSecurityTokenTemplate>
<wsp:Policy>
<sp:RequireDerivedKeys />
<sp:RequireInternalReference />
</wsp:Policy>
</sp:IssuedToken>
</wsp:Policy>
</sp:EndorsingSupportingTokens>
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<xenc:EncryptedKey>
...
</xenc:EncryptedKey>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<saml:Assertion>
...
</saml:Assertion>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<xenc:EncryptedKey>
...
</xenc:EncryptedKey>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<saml:Assertion>
...
</saml:Assertion>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp u:Id="_0">
...
</wsu:Timestamp>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wssc:DerivedKeyToken>
...
</wssc:DerivedKeyToken>
<wsse11:SignatureConfirmation />
<wsse11:SignatureConfirmation />
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
6.3 Kerberos
在此身份验证模式下,客户端使用 Kerberos 票证向服务进行身份验证。 该票证还提供服务器身份验证。 所用绑定为对称绑定,具有以下属性:
保护令牌:Kerberos 票证,包含模式设置为 .../IncludeToken/Once 令牌保护:False
整个标头和正文签名:True
保护顺序:SignBeforeEncrypt
加密签名:True
策略
<wsp:Policy wsu:Id='Kerberos_policy' >
<wsp:ExactlyOne>
<wsp:All>
<sp:SymmetricBinding>
<wsp:Policy>
<sp:ProtectionToken>
<wsp:Policy>
<sp:KerberosToken sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Once' >
<wsp:Policy>
<sp:RequireDerivedKeys />
<sp:WssGssKerberosV5ApReqToken11 />
</wsp:Policy>
</sp:KerberosToken>
</wsp:Policy>
</sp:ProtectionToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic128 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
<sp:EncryptSignature />
<sp:OnlySignEntireHeadersAndBody />
</wsp:Policy>
</sp:SymmetricBinding>
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
<sp:MustSupportRefThumbprint />
<sp:MustSupportRefEncryptedKey />
</wsp:Policy>
</sp:Wss11>
<sp:Trust10>
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsse:BinarySecurityToken>
...
</wsse:BinarySecurityToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
响应
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求
<wsse:Security>
TBD
</wsse:Security>
响应
<wsse:Security>
TBD
</wsse:Security>
6.4 IssuedToken
在此身份验证模式下,客户端不向服务进行身份验证,而是提供一个由 STS 颁发的令牌,并证明掌握了共享密钥。 服务也不向客户端进行身份验证,而是由 STS 将共享密钥作为颁发的令牌的一部分进行加密,这样,只有服务才能解密该密钥。 所用绑定为对称绑定,具有以下属性:
保护令牌:颁发的令牌,包含模式设置为 .../IncludeToken/AlwaysToRecipient 令牌保护:False
整个标头和正文签名:True
保护顺序:SignBeforeEncrypt
加密签名:True
策略
<wsp:Policy wsu:Id='CustomBinding_ISimple3_policy' >
<wsp:ExactlyOne>
<wsp:All>
<sp:SymmetricBinding>
<wsp:Policy>
<sp:ProtectionToken>
<wsp:Policy>
<sp:IssuedToken sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<sp:RequestSecurityTokenTemplate>
<wst:KeyType>
http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey
</wst:KeyType>
</sp:RequestSecurityTokenTemplate>
<wsp:Policy>
<sp:RequireDerivedKeys />
<sp:RequireInternalReference />
</wsp:Policy>
</sp:IssuedToken>
</wsp:Policy>
</sp:ProtectionToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
<sp:EncryptSignature />
<sp:OnlySignEntireHeadersAndBody />
</wsp:Policy>
</sp:SymmetricBinding>
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
<sp:MustSupportRefThumbprint />
<sp:MustSupportRefEncryptedKey />
</wsp:Policy>
</sp:Wss11>
<sp:Trust10>
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<saml:Assertion>
...
</saml:Assertion>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
响应
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<saml:Assertion>
...
</saml:Assertion>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
6.5 将 SslNegotiated 用于服务身份验证
本节介绍的一组身份验证模式将对称绑定用于保护令牌,作为安全上下文令牌(符合 WS-SecureConversation (WS-SC)),其键值是通过对 WS-Trust (WS-T) RST/RSTR 消息执行 TLS 协议进行协商的。 有关使用 WS-Trust 实现 TLS 握手的详细信息,请参见 TLSNEGO 中的内容。 此处的消息示例中,我们假设已通过握手建立了带有关联安全上下文的 SCT。
所用绑定为对称绑定,具有以下属性:
保护令牌:SslContextToken,包含模式设置为 .../IncludeToken/Never 令牌保护:False
整个标头和正文签名:True
保护顺序:SignBeforeEncrypt
加密签名:True
6.5.1 SslNegotiated 服务身份验证的策略
本节介绍的所有身份验证模式的策略都相似,唯一的区别在于,所用的特定签名支持令牌或认可令牌不相同。
<wsp:Policy wsu:Id='SslNegotiated_policy' >
<wsp:ExactlyOne>
<wsp:All>
<sp:SymmetricBinding>
<wsp:Policy>
<sp:ProtectionToken>
<wsp:Policy>
<mssp:SslContextToken sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient'>
<wsp:Policy>
<sp:RequireDerivedKeys />
</wsp:Policy>
</mssp:SslContextToken>
</wsp:Policy>
</sp:ProtectionToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
<sp:EncryptSignature />
<sp:OnlySignEntireHeadersAndBody />
</wsp:Policy>
</sp:SymmetricBinding>
<!-- Supporting token assertions go here -->
..
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
<sp:MustSupportRefThumbprint />
<sp:MustSupportRefEncryptedKey />
</wsp:Policy>
</sp:Wss11>
<sp:Trust10>
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
6.5.2 AnonymousForSslNegotiated
在此身份验证模式下,客户端是匿名的,而使用 X.509 证书对服务进行身份验证。 所用绑定是对称绑定的一个实例,如上面 6.5.1 中所述。
策略
请参见上面 6.5.1 中的“策略”以了解绑定详细信息。
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:SecurityContextToken>
...
</wsc:SecurityContextToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
响应
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:SecurityContextToken>
...
</wsc:SecurityContextToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
6.5.3 UserNameForSslNegotiated
在此身份验证模式下,客户端使用“用户名令牌”进行身份验证,该令牌作为签名支持令牌出现在 SOAP 层上。 使用 X.509 证书对服务进行身份验证。 所用绑定是对称绑定的一个实例,如上面 6.5.1 中所述。
策略
请参见上面的第 6.5.1 节以了解绑定详细信息
签名支持令牌
<sp:SignedSupportingTokens>
<wsp:Policy>
<sp:UsernameToken sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<wsp:Policy>
<sp:WssUsernameToken10 />
</wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SignedSupportingTokens>
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:SecurityContextToken>
...
</wsc:SecurityContextToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
响应
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:SecurityContextToken>
...
</wsc:SecurityContextToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
6.5.4 IssuedTokenForSslNegotiated
在此身份验证模式下,客户端不向服务进行身份验证,而是出示一个由 STS 颁发的令牌,并证明掌握了共享密钥。 颁发的令牌作为认可支持令牌出现在 SOAP 层上。 使用 X.509 证书对服务进行身份验证。 所用绑定是对称绑定的一个实例,如上面 6.5.1 中所述。
策略
请参见上面的第 6.5.1 节以了解绑定详细信息
认可支持令牌
<sp:EndorsingSupportingTokens>
<wsp:Policy>
<sp:IssuedToken sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<sp:RequestSecurityTokenTemplate>
<wst:KeyType>
http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey
</wst:KeyType>
</sp:RequestSecurityTokenTemplate>
<wsp:Policy>
<sp:RequireDerivedKeys />
<sp:RequireInternalReference />
</wsp:Policy>
</sp:IssuedToken>
</wsp:Policy>
</sp:EndorsingSupportingTokens>
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:SecurityContextToken>
...
</wsc:SecurityContextToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<saml:Assertion>
...
</saml:Assertion>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
响应
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:SecurityContextToken>
...
</wsc:SecurityContextToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<saml:Assertion>
...
</saml:Assertion>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsse11:SignatureConfirmation />
<wsse11:SignatureConfirmation />
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
6.5.5 MutualSslNegotiated
在此身份验证模式下,客户端和服务都使用 X.509 证书进行身份验证。 所用绑定是对称绑定的一个实例,如上面 6.5.1 中所述。
策略
请参见上面的第 6.5.1 节以了解绑定详细信息
认可支持令牌
<sp:EndorsingSupportingTokens>
<wsp:Policy>
<sp:X509Token sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<wsp:Policy>
<sp:RequireThumbprintReference />
<sp:WssX509V3Token10 />
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:EndorsingSupportingTokens>
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:SecurityContextToken>
...
</wsc:SecurityContextToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
响应
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:SecurityContextToken>
...
</wsc:SecurityContextToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
6.6 SspiNegotiated
在此身份验证模式下,将使用协商协议来执行客户端和服务器身份验证。 如果可能,就使用 Kerberos,否则使用 NTLM。 所用绑定为对称绑定,具有以下属性:
保护令牌:SpnegoContextToken,包含模式设置为 .../IncludeToken/AlwaysToRecipient 令牌保护:False
整个标头和正文签名:True
保护顺序:SignBeforeEncrypt
加密签名:True
策略
<wsp:Policy wsu:Id='CustomBinding_ISimple13_policy' >
<wsp:ExactlyOne>
<wsp:All>
<sp:SymmetricBinding>
<wsp:Policy>
<sp:ProtectionToken>
<wsp:Policy>
<sp:SpnegoContextToken sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<wsp:Policy>
<sp:RequireDerivedKeys />
</wsp:Policy>
</sp:SpnegoContextToken>
</wsp:Policy>
</sp:ProtectionToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
<sp:EncryptSignature />
<sp:OnlySignEntireHeadersAndBody />
</wsp:Policy>
</sp:SymmetricBinding>
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
<sp:MustSupportRefThumbprint />
<sp:MustSupportRefEncryptedKey />
</wsp:Policy>
</sp:Wss11>
<sp:Trust10>
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:SecurityContextToken>
...
</wsc:SecurityContextToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
响应
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:SecurityContextToken>
...
</wsc:SecurityContextToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
6.7 SecureConversation
所用绑定为对称绑定,保护令牌为符合 WS-SecureConversation (WS-SC) 的 SCT。 该 SCT 是根据嵌套的绑定使用 WS-Trust (WS-Trust) 或 WS-SecureConversation (WS-SC) 协商的,该嵌套绑定本身是使用协商协议的对称绑定。 如果可能,协商协议将使用 Kerberos 来执行客户端和服务器身份验证。 如果无法使用 Kerberos,则退而使用 NTLM。
策略
<wsp:Policy wsu:Id='SecureConversation_policy' >
<wsp:ExactlyOne>
<wsp:All>
<sp:SymmetricBinding>
<wsp:Policy>
<sp:ProtectionToken>
<wsp:Policy>
<sp:SecureConversationToken sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<wsp:Policy>
<sp:RequireDerivedKeys />
<sp:BootstrapPolicy>
<wsp:Policy>
<sp:SignedParts>
<sp:Body />
<sp:Header Name='To' Namespace='http://www.w3.org/2005/08/addressing' />
<sp:Header Name='From' Namespace='http://www.w3.org/2005/08/addressing' />
<sp:Header Name='FaultTo' Namespace='http://www.w3.org/2005/08/addressing' />
<sp:Header Name='ReplyTo' Namespace='http://www.w3.org/2005/08/addressing' />
<sp:Header Name='MessageID' Namespace='http://www.w3.org/2005/08/addressing' />
<sp:Header Name='RelatesTo' Namespace='http://www.w3.org/2005/08/addressing' />
<sp:Header Name='Action' Namespace='http://www.w3.org/2005/08/addressing' />
</sp:SignedParts>
<sp:EncryptedParts>
<sp:Body />
</sp:EncryptedParts>
<sp:SymmetricBinding>
<wsp:Policy>
<sp:ProtectionToken>
<wsp:Policy>
<sp:SpnegoContextToken sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient' >
<wsp:Policy>
<sp:RequireDerivedKeys />
</wsp:Policy>
</sp:SpnegoContextToken>
</wsp:Policy>
</sp:ProtectionToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
<sp:EncryptSignature />
<sp:OnlySignEntireHeadersAndBody />
</wsp:Policy>
</sp:SymmetricBinding>
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
<sp:MustSupportRefThumbprint />
<sp:MustSupportRefEncryptedKey />
</wsp:Policy>
</sp:Wss11>
<sp:Trust10>
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
</wsp:Policy>
</sp:BootstrapPolicy>
</wsp:Policy>
</sp:SecureConversationToken>
</wsp:Policy>
</sp:ProtectionToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
<sp:EncryptSignature />
<sp:OnlySignEntireHeadersAndBody />
</wsp:Policy>
</sp:SymmetricBinding>
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
<sp:MustSupportRefThumbprint />
<sp:MustSupportRefEncryptedKey />
</wsp:Policy>
</sp:Wss11>
<sp:Trust10>
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust10>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
安全标头示例:SignBeforeEncrypt、EncryptSignature
请求
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:SecurityContextToken>
...
</wsc:SecurityContextToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
响应
<wsse:Security s:mustUnderstand="1">
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
<xenc:EncryptedData>
...
</xenc:EncryptedData>
</wsse:Security>
安全标头示例:EncryptBeforeSign
请求
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:SecurityContextToken>
...
</wsc:SecurityContextToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>
响应
<wsse:Security>
<wsu:Timestamp>
...
</wsu:Timestamp>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<wsc:DerivedKeyToken>
...
</wsc:DerivedKeyToken>
<ds:Signature>
...
</ds:Signature>
<xenc:ReferenceList>
...
</xenc:ReferenceList>
</wsse:Security>