2

我通过 WSS4JSecurityInterceptor 使用 Spring WS Security。但是,在验证签名时,我需要读取密钥库密码。

密钥库密码将被加密。在验证签名之前,您能告诉我如何解密它吗?

我的配置如下:

<bean id="wsSecurityInterceptor" class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
    <property name="validationActions" value="Signature"/>
    <property name="validationSignatureCrypto">
        <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>

谢谢

4

1 回答 1

4

使用 Spring 进行签名 - Ws WSS4JSecurityInterceptor

生成的 Keytool 使用:

keytool -genkey -alias signFiles -keypass kpi135 -keystore akulastore.jks -storepass ab987c

为 Keytool 生成证书:

keytool -certreq -alias signFiles -keystore akulastore.jks -file cert.csr

将 Keytool、证书放在客户端。

将 Keytool 放在服务器端

并将配置设置为:

Server Side Interceptor

<bean id="wsDigCerSecurityInterceptor" 
   class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
<property name="validationActions" value="Signature"/>
<property name="validationSignatureCrypto">
<bean
   class="org.springframework.ws.soap.security.wss4j.support.CryptoFactoryBean">
<property name="keyStorePassword" value="ab987c"/>
<property name="keyStoreLocation" value="classpath:/akulastore.jks"/>
</bean>
</property>
</bean>


Client Side Interceptor

<bean id="wsDigCerSecurityInterceptor"
   class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
<property name="securementActions" value="Signature"/>
<property name="securementUsername" value="signFiles"/>
<property name="securementPassword" value="kpi135"/>
<property name="securementSignatureCrypto">
<bean 
   class="org.springframework.ws.soap.security.wss4j.support.CryptoFactoryBean">
<property name="keyStorePassword" value="ab987c"/>
<property name="keyStoreLocation" value="classpath:/akulastore.jks"/>
</bean>
</property>
</bean>
于 2013-03-07T13:51:54.197 回答