【问题标题】:how to add timestamp to signature using Wss4jSecurityInterceptor / Spring WS如何使用 Wss4jSecurityInterceptor / Spring WS 为签名添加时间戳
【发布时间】:2015-08-13 05:18:19
【问题描述】:

我想为我的签名添加一个在 20000 毫秒后过期的时间戳。 我必须在我的配置中添加什么?

我的配置如下:

<bean class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
    <property name="securementActions" value="Signature"/>
    <property name="securementUsername" value="mykey"/>
    <property name="securementPassword" value="123456"/>
    <property name="securementSignatureCrypto">
        <bean class="org.springframework.ws.soap.security.wss4j.support.CryptoFactoryBean">
            <property name="keyStorePassword" value="123456"/>
            <property name="keyStoreLocation" value="classpath:/keystore.jks"/>
        </bean>
    </property>
</bean>

【问题讨论】:

    标签: java web-services spring-ws wss4j


    【解决方案1】:

    您可以执行以下操作(来源 here 第 7.3.4.1 节):

    <bean class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
        <property name="validationActions" value="Timestamp"/>
        <property name="timestampStrict" value="true"/>
        <property name="timeToLive" value="10"/>
    </bean>
    

    似乎较新的版本具有以下属性名称“securementTimeToLive”而不是 timeToLive,并且默认设置为 300。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-21
      • 2018-11-25
      • 2023-03-14
      • 1970-01-01
      相关资源
      最近更新 更多