Sergii
Sergii

Reputation: 562

tomcat and java.security.Security

I have tomcat 6.0 with 2 webapps. One of them executes the following code:

java.security.Security.addProvider(new cryptix.jce.provider.CryptixCrypto());

This makes this provider available in the second app but I don't want that.

Please explain why this is happening and how I can fix it?

Upvotes: 2

Views: 2499

Answers (1)

Mike Samuel
Mike Samuel

Reputation: 120566

Providers are global.

Returns an array containing all the installed providers. The order of the providers in the array is their preference order.

The only thing you might have control over is the preference order of the providers. You can't make one set of providers available to one part of your code and not to another without running them in separate JVMs, since java.security is, I believe, loaded by the bootstrap classloader.

Upvotes: 4

Related Questions