小编mar*_*are的帖子

在spring-ws(wss4j)中添加加密/解密的正确方法是什么?

我已经部署了2个Web应用程序,一个代表Web服务,另一个代表ws客户端.当使用SIGNING和TIMESTAMP-ing时,一切正常,客户端标记消息(但我认为他没有覆盖默认的300s ttl),用他的x509证书签名消息,并将其发送给ws.另一方面,他收集消息并能够在其密钥库中对客户端可信证书进行时间戳和证书/签名.

当我向我的配置添加加密操作时出现问题.客户端似乎能够加密消息,但似乎没有兴趣解密消息.他只是看到没有端点映射

[SaajSoapMessage {http://www.w3.org/2001/04/xmlenc#}EncryptedData] 

并投掷

WebServiceTransportException: Not Found [404] exception.

有人可以解释我需要做些什么来实现时间戳,使用x509进行签名和加密,再次使用x509?

服务器app-context的一部分:

<bean id="wss4jSecurityInterceptor" class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor"> 
        <!-- valiadation -->
        <property name="validationActions" value="Timestamp Signature Encrypt"/> 
        <property name="enableSignatureConfirmation" value="true"/> 
        <property name="validationSignatureCrypto"> 
            <ref bean="keystore"/> 
        </property> 
        <property name="validationDecryptionCrypto"> 
                <ref bean="keystore"/> 
        </property> 
        <property name="validationCallbackHandler"> 
            <bean class="org.springframework.ws.soap.security.wss4j.callback.KeyStoreCallbackHandler"> 
                <property name="privateKeyPassword" value="password"/> 
            </bean> 
        </property> 
         <!-- timestamp options -->
        <property name="timestampStrict" value="true"/> 
        <property name="timeToLive" value="30"/> 
        <property name="timestampPrecisionInMilliseconds" value="true"/> 
         <!-- signing and encryption -->
        <property name="securementActions" value="Timestamp Signature Encrypt"/> 
        <property name="securementUsername" value="wsserver"/> 
        <property name="securementPassword" value="password"/> 
        <property name="securementSignatureKeyIdentifier" value="DirectReference"/> 

        <property name="securementSignatureCrypto"> …
Run Code Online (Sandbox Code Playgroud)

java encryption spring web-services spring-ws

6
推荐指数
1
解决办法
5235
查看次数

标签 统计

encryption ×1

java ×1

spring ×1

spring-ws ×1

web-services ×1