为 WSDL 变换策略和绑定声明

Web Service 安全性不完全支持 OASIS WS-SecurityPolicy V1.2 标准。 但是,可以变换 WebSphere® Application Server 支持的多个策略和绑定断言,并将其表示为 WS-SecurityPolicy V 1.2 断言。 当在消息中收到 Web 服务描述语言 (WSDL) 或 Web Service 元数据交换 (WS-MEX) 请求时,以及当客户机收到包含 WS-SecurityPolicy 1.2 断言的策略时,受支持的断言将进行转换。

WebSphere Application Server 接收 WSDL 或 WS-MEX 请求时,某些策略和绑定断言将转换为标准断言并包含在嵌入到 WSDL 中的策略中。 此外,当客户机接收包含这些 WS-SecurityPolicy 声明的策略时,这些声明将变换回由产品所指定的声明,以便 Application Server 运行时可以对其进行处理。 此变换提供了 Application Server 与其他系统之间的互操作性,该操作性支持 WS-SecurityPolicy V1.2 标准。

以下 WS-SecurityPolicy 1.2 声明可以在返回到 WSDL 或 WS-MEX 请求的策略中进行表达。

EncryptSignature
在产品中使用加密元素的 XPath 表达式进行表达。
EncryptBeforeSigning
在绑定出站段上的 encryptionInfo 和 signingInfo 元素的顺序属性确定了该顺序发生变换的地点以及是否需要设置该声明。 该缺省行为要在加密之前进行签署。
ContentEncryptedElements
使用加密的元素中以 /node() 为结尾的 XPath 表达式进行表达。 Application Server 可以消耗此策略声明,但是不能变换以 /node() 为结尾的现有的 XPath 表达式。
KerberosToken
使用策略和绑定中的定制令牌进行表达。 根据期望的 Kerberos 令牌类型,Kerberos 定制令牌声明指定了 http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#GSS_Kerberosv5_AP_REQ 或 http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#Kerberosv5_AP_REQ 的本地名称。 并且,绑定中还有定制 属性 (com.ibm.wsspi.wssecurity.krbtoken.requireDerivedKey),它指定使用 Kerberos 的导出密钥。 使用定制令牌的本地名称和从该产品表达式中导出的密钥定制属性,可以创建等价的 V1.2 表达式。
需要<variable>参考,其中 <variable> 是下列其中一项: KeyIdentifier, IssuerSerial, EmbeddedToken或 Thumbprint
使用绑定中 keyInfo 上的类型属性进行表达。
MustSupportRef<variable>,其中 <variable> 是下列其中一项: KeyIdentifier, IssuerSerial, EmbeddedToken或 Thumbprint
此断言未在 WebSphere Application Server 策略中表示,但产品支持所有四种类型的引用。
SignatureConfirmation 元素的保护
将 SignatureConfirmation 元素暗中签署并加密。 但是,如果响应中不对任何元素进行加密,那么对 SignatureConfirmation 元素也不加密,同时如果在相应中不对任何元素进行签署,那么对 SignatureConfirmation 元素也不加密。 在变换过程中,将表示 SignatureConfirmation 元素签名或加密的所有 XPath 表达式从策略中移除。 在 Web Service 安全性绑定中提供了 explicitlyProtectSignatureConfirmation 属性以禁用响应消息上 SignatureConfirmation 元素的隐式签名和加密。 这将提供与 WebSphere Application Server V 6.1.x的互操作性。 要添加该属性,请在缺省策略集绑定的“认证和保护”面板中选中禁用签名确认的隐式保护选项。 如果在绑定中呈现 explicitlyProtectSignatureConfirmation 属性,那么在变换过程中表示对 SignatureConfirmation元素签名和加密的所有 XPath 表达式将保持不变。
SC13SecurityContextToken
在安全性上下文令牌的绑定中,通过指定本地名称 http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512,支持“安全性上下文令牌”V1.3。
RequireImpliedDerivedKeys
在令牌生成器绑定中通过添加定制属性 (com.ibm.ws.wssecurity.token.generateImpliedDerivedKey) 来支持此项。
ExactlyOne
当使用调用者时将变换该声明。 调用者指定用于认证的令牌。 ExactlyOne 声明与该服务期望的调用者令牌进行通信。 All caller options are enclosed inside the <ExactlyOne> assertion, and each option is enclosed inside the <wsp:All> assertion. 由于名称隐藏,所以客户机仅发送令牌类型之一。 例如,在服务器端绑定中,使用产品表示,指定以下调用者选项:
 <caller order="1">
        <jAASConfig configName="system.wss.caller"/>
        <callerIdentity uri="" localName="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken"/>
 </caller>
 <caller order="2">
        <jAASConfig configName="system.wss.caller"/>
        <callerIdentity localName="LTPA" uri="http://www.ibm.com/websphere/appserver/tokentype/5.0.2" />
</caller>
该声明显示了,UsernameToken 令牌或 LTPA 令牌用作调用者。 如下面示例中所示,使用这两种类型令牌中的一种的要求将传达给变换策略中的客户机:
<sp:ExactlyOne>
<wsp:All> 
<sp:SupportingTokens>
   <wsp:Policy wsu:Id="request:token_auth">
     <sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512/IncludeToken/AlwaysToRecipient">
       <wsp:Policy>
         <sp:WssUsernameToken10 />
       </wsp:Policy>
     </sp:UsernameToken>
 </wsp:Policy>
</sp:SupportingTokens>
</wsp:All>
<wsp:All> 
<sp:SupportingTokens>
<wsp:Policy wsu:Id="request:token_auth">
     <spe:LTPAToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512/IncludeToken/AlwaysToRecipient" />
</wsp:Policy>
 </sp:SupportingTokens>
<wsp:All>
</sp:ExactlyOne>

在变换过程中不得替换由该产品所指定的策略声明 LTPAToken 和 LTPAPropagationToken。 如果这些声明出现于正在进行变换的策略中,那么它们将包含于 WSDL 的嵌入式策略中。 这允许 WebSphere Application Server 客户机与 WebSphere Application Server 服务提供者进行互操作。