I am working with Spring integration + Spring WS Security through WSS4JSecurityInterceptor.
I have a WS client consuming a Web service on the server with the next security scenario:
- Https pre-emptive authentication (User and password)
- The server side gives me a .cert file to sign but I don’t know how to convert is to a .jks (keystore file)
With these two requisites, I am a bit confused with the examples provided by Spring documentation about client / server configuration. I can’t change any configuration on the server side. I just have: User, password and .cert file.
I have the next Java configuration but I am not sure if it solves my detailed scenario:
@Bean
public Wss4jSecurityInterceptor wss4jSecurityInterceptor() throws IOException, Exception{
Wss4jSecurityInterceptor interceptor = new Wss4jSecurityInterceptor();
interceptor.setSecurementActions("UsernameToken Encrypt");
interceptor.setSecurementUsername("https user");
interceptor.setSecurementPassword("https password");
interceptor.setValidationActions("Signature");
interceptor.setValidationSignatureCrypto( NEED TO BE DEFINED );
return interceptor;
}