jQuery in Action, 2nd edition*
The moose likes Web Services and the fly likes How to force Crypto engine to reload a Keystore? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to force Crypto engine to reload a Keystore?" Watch "How to force Crypto engine to reload a Keystore?" New topic
Author

How to force Crypto engine to reload a Keystore?

Oscar Romero
Greenhorn

Joined: Jun 27, 2010
Posts: 6
Hi,

I'm facing a problem which I have to resolve as soon as possible, and any help would be really appreciated guys. I have a WS up and running and I need that everytime a public key is added or deleted from the Keystore, the clients which are validating against this server Keystore, can see the changes in it dynamically, without having to restart the server.

I'm yet to find any clue on the network. I'll keep searching though.

Thanks in advance, and sorry about bad english.
R Srini
Ranch Hand

Joined: Feb 19, 2010
Posts: 215
Hi. This article Configuring Keystore dynamically in WebServices using Metro sounds like it might be of help. Let me know how that works out The link uses Metro, but you can implement the same thing in Axis if that is what you are using. Best of luck!
Oscar Romero
Greenhorn

Joined: Jun 27, 2010
Posts: 6
Thanks Srini!

I'll give it a look and see if I can get it to work. I'm using CXF by the way.

Oscar Romero
Greenhorn

Joined: Jun 27, 2010
Posts: 6
Well, I finally solved the problem.

We are using CXF + WSS4J, so all I had to do is create a custom in-interceptor that extends WSS4JInInterceptor and override the method loadSignatureCrypto.

Basically I got the KeyStore held by the Crypto object and realoded it with an input stream containing the KeyStore stored in the server. It works perfectly.
R Srini
Ranch Hand

Joined: Feb 19, 2010
Posts: 215
Very nice. Thank you for sharing the solution.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to force Crypto engine to reload a Keystore?