CXF: How to secure SSL certificate dynamically?

I have a CXF 2.7.10 generated client for SOAP SSL WebService. How can I specify a private key / certificate (ideally in pem format) at runtime for it instead of hard-coding JKS in an XML configuration?

+3
source share
1 answer

Take a look at this blog post that implements the implementation of the WSS4J Crypto interface created by extending CryptoBase , obtaining public keys from a centralized PKI repository, and the private key from the default cryptographic provider ( Merlin ) in the local key repository, as usual.

In your case, if you want to continue using the default keystore for public keys, you can reverse the implementation of public / private key searches.

Source Code Links: WSS4J Merlin.java extends CryptoBase.java

+3
source

All Articles