WLS WS-SecurityPolicy 1.0断言,第二部分

本文详细解析了Integrity断言的XML模式定义及其各元素的作用,例如SignatureAlgorithm指定了签名方法的算法,Target则提供了对消息中特定部分进行签名的细节。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 我们首先来看Integrity断言的模式定义:
<element name="Integrity">
    <complexType>
      <sequence>
        <element name="SignatureAlgorithm" type="secpol:AlgorithmType"/>
        <element name="CanonicalizationAlgorithm" type="secpol:AlgorithmType"/>
        <element name="Target" type="secpol:IntegrityTargetType" minOccurs="1" maxOccurs="unbounded"/>
        <element name="SupportedTokens" type="secpol:SupportedTokensType" minOccurs="0"/>
      </sequence>
      <attribute name="SignToken" type="xsd:boolean" default="true"/>
    </complexType>
  </element>

  SignToken属性用于说明签名是否会包括用于签名的密钥。SignatureAlgorithm元素指定了SignedInfo的签名方法的算法。CanonicalizationAlgorithm指定了标准方法的算法。Target元素则提供了对消息中的特定块进行签名的细节。它对应于SignedInfo中的Reference。可以有一个或多个Target。SupportedTokens元素指定了所支持的进行签名的安全令牌的类型。它也可以省略,这种情况下Integrity断言就成为“抽象”(abstract)。服务运行时会动态地将其补上,这使配置更为灵活。我将单独写一篇文章,详细介绍抽象策略的概念,并说明如何使用Qname和Xpath表达式指定Target元素。

  WLS 9.0附带了一个内置的WS-SecurityPolicy文件,Sign.xml,它包含了对SOAP消息使用数字签名的大多数常见用例。下面是Integrity断言的一个代码片段:

 <wssp:Integrity>
    
    <wssp:SignatureAlgorithm URI="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
    <wssp:CanonicalizationAlgorithm URI="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    
    <wssp:Target>
      <wssp:DigestAlgorithm URI="http://www.w3.org/2000/09/xmldsig#sha1" />
      <wssp:MessageParts Dialect="http://www.bea.com/wls90/security/policy/wsee#part"> 
        wls:SystemHeaders()
      </wssp:MessageParts>
    </wssp:Target>
    
    <wssp:Target>
      <wssp:DigestAlgorithm URI="http://www.w3.org/2000/09/xmldsig#sha1" />
      <wssp:MessageParts Dialect="http://www.bea.com/wls90/security/policy/wsee#part"> 
        wls:SecurityHeader(wsu:Timestamp)
      </wssp:MessageParts>
    </wssp:Target>
    
    <wssp:Target>
      <wssp:DigestAlgorithm URI="http://www.w3.org/2000/09/xmldsig#sha1" />
      <wssp:MessageParts Dialect="http://schemas.xmlsoap.org/2002/12/wsse#part">
      wsp:Body()
      </wssp:MessageParts>
    </wssp:Target>
</wssp:Integrity>

  策略要求所有的WLS系统标题(如:WS-Addressing标题)都必须进行签名。签名还在wsse:Security soap标题中包括soap主体和时间戳元素。因为SignToken属性使用默认值true,签名密钥也将受到保护。

原文出处:http://dev2dev.bea.com/blog/jlee/archive/2005/09/wls_wssecurityp_2.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值