
Originally Posted by
ghazouli
I have developed the code to sign calls from the client side using x509 certificates and also added the server side code but seem to get a strange error. Not sure if it is the policy file or bad certificates. I developed a call back bean to sign the message using my keystore. Here is the context configuration:
<bean id="signMessageCallback" class="com.truewind.ws.SignMessageCallback">
<constructor-arg value="securityPolicy.xml" />
<constructor-arg>
<bean
class="org.springframework.ws.soap.security.xwss.c allback.KeyStoreCallbackHandler">
<property name="keyStore">
<bean class="org.springframework.ws.soap.security.suppor t.KeyStoreFactoryBean">
<property name="location" ref="signatureKeyStoreFile"/>
<property name="password" value="@{signature.keystore.password}"/>
</bean>
</property>
<property name="defaultAlias" value="@{default.alias}"/>
<property name="privateKeyPassword" value="@{privateKey.password}"/>
</bean>
</constructor-arg>
<property name="soapAction" value="@{soap.action}" />
</bean>
On the server side I have configured the XwsSecurityInterceptor and a KeyStoreCallBackHandler for checking the x509 certificate. I have added the following configuration to the spring-ws-servlet.xml:
<bean id="keyStoreHandler" class="org.springframework.ws.soap.security.xwss.c allback.KeyStoreCallbackHandler">
<property name="trustStore" ref="trustStore"/>
</bean>
<bean id="trustStore" class="org.springframework.ws.soap.security.suppor t.KeyStoreFactoryBean">
<property name="location" value="classpath:trust_store.jks"/>
<property name="password" value="test"/>
</bean>
<bean id="wsSecurityInterceptor"
class="org.springframework.ws.soap.security.xwss.X wsSecurityInterceptor">
<property name="policyConfiguration" value="classpath:securityPolicy.xml"/>
<property name="callbackHandler" ref="keyStoreHandler"/>
<property name="validateRequest" value="false"></property>
</bean>
Now I am getting a Security Verification Error. I checked to make sure the certificate I am signing with is indeed in the truststore and vice versa. I have been trying for days to figure this out but have been running into a brick wall.
I will exchange my design with you if you can help me diagnose this issue. Let me know.
Thanks,
Hisham