Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.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
Spring WS-SSL握手和消息加密的独立密钥库_Ssl_Spring Ws_Webservicetemplate - Fatal编程技术网

Spring WS-SSL握手和消息加密的独立密钥库

Spring WS-SSL握手和消息加密的独立密钥库,ssl,spring-ws,webservicetemplate,Ssl,Spring Ws,Webservicetemplate,我有一个关于你的问题 博罗达克回答 无需将密钥导入密钥库 如果我们不提供密钥库,那么Httpclient将使用什么来发送SSL握手的客户端证书 我需要在业务合作伙伴上调用web服务- 使用公钥证书X使用SSL进行身份验证 b使用公钥证书Y对SOAP消息进行加密和签名 我想我需要将证书Y指定为以下内容: <bean class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor"> <

我有一个关于你的问题

博罗达克回答

无需将密钥导入密钥库

如果我们不提供密钥库,那么Httpclient将使用什么来发送SSL握手的客户端证书

我需要在业务合作伙伴上调用web服务-

使用公钥证书X使用SSL进行身份验证

b使用公钥证书Y对SOAP消息进行加密和签名

我想我需要将证书Y指定为以下内容:

<bean class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
    <property name="securementActions" value="Signature"/>
    <property name="securementSignatureKeyIdentifier" value="DirectReference"/>
    <property name="securementUsername" value="mycert"/>
    <property name="securementPassword" value="certpass"/>
    <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>
我不确定如何/在何处为SSL握手指定证书X。我认为这是HttpClient,但我在borodark发布的XML中没有看到它


请帮忙

在配置密钥库的xml文件中,应该有如下内容:

            <beans>
               <bean id="keyStoreHandler" class="org.springframework.ws.soap.security.xwss.callback.KeyStoreCallbackHandler">
               <property name="keyStore" ref="keyStore"/>
               <property name="privateKeyPassword" value="changeit"/>
           </bean>

           <bean id="keyStore" class="org.springframework.ws.soap.security.support.KeyStoreFactoryBean">
               <property name="location" value="classpath:keystore.jks"/>
               <property name="password" value="changeit"/>
           </bean>
       </beans>
这里的线索是

     <property name="location" value="classpath:keystore.jks"/>
这是通往密钥库的路径。。现在,您可能可以在ssl handhshake的密钥库中使用某个别名,这就是您在此处配置的,另外,安全策略在同一个文件上使用,但在securitypolicy文件中,您可以再次指定不同的别名。。这就应该奏效了。。 考虑到

    <property name="location" value="classpath:keystore.jks"/>
指示您可以使用其他表单引用war本身之外的资源的类路径,并允许您在根本不涉及war的情况下更改证书