Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/397.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在WSS4J Spring Security中使用加密密码_Java_Encryption_Spring Ws - Fatal编程技术网

Java 如何在WSS4J Spring Security中使用加密密码

Java 如何在WSS4J Spring Security中使用加密密码,java,encryption,spring-ws,Java,Encryption,Spring Ws,我通过WSS4JSecurityInterceptor使用SpringWS-Security。然而,在验证签名时,我需要读取密钥库密码 密钥库密码将被加密。在验证签名之前,你能告诉我如何解密吗 我的配置如下: <bean id="wsSecurityInterceptor" class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor"> <property name="valida

我通过WSS4JSecurityInterceptor使用SpringWS-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>


感谢使用Spring-Ws WSS4JSecurityInterceptor进行签名

使用以下工具生成密钥工具:

keytool -genkey -alias signFiles -keypass kpi135 -keystore akulastore.jks -storepass ab987c
为密钥工具生成证书:

keytool -certreq -alias signFiles -keystore akulastore.jks -file cert.csr
将密钥工具、证书放在客户端

将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>
服务器端拦截器
客户端拦截器

使用Spring-Ws WSS4JSecurityInterceptor的签名

使用以下工具生成密钥工具:

keytool -genkey -alias signFiles -keypass kpi135 -keystore akulastore.jks -storepass ab987c
为密钥工具生成证书:

keytool -certreq -alias signFiles -keystore akulastore.jks -file cert.csr
将密钥工具、证书放在客户端

将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>
服务器端拦截器
客户端拦截器