2

I am using CXF with WSS4J Interceptors and I want to fetch the keys and certificates from the DB rather than the standard Merlin propfile/JKS solution. I have started with a simple CryptoImplementation, but the methods never get called.

public class StorageCryptoProvider extends CryptoBase {

    @Override
    public PrivateKey getPrivateKey(String identifier, String password)
        throws WSSecurityException {
    return fetchFromDB();
    }
}

I registered the Crypto Provider in the Properties File as the "org.apache.ws.security.crypto.provider=StorageCryptoProvider".

For the encryption I am using a standard WSS4 OutInterceptor.

client.getOutInterceptors().add(new WSS4JOutInterceptor(outProps));

Please provide some guidance, if this approach is viable and what it is lacking.
Very much appreciated, thank you.

Mawillec
  • 85
  • 7

0 Answers0