Maxime Colas des Francs wrote:

> I attempt to use openpgp in my web application
> For that i use an external provider.
> I put jar files in WEB-INF/lib and in a 'load-on-startup' servlet, i call
> Security.addProvider() and i read a public key from a file for futur
> encryptions.
> 
> I start tomcat manually (with startup.sh) and it works, i encrypt
> 
> but my problem is :
> when application restart "not manually", by class modified or by manager
> application stop & start request,
> my 'load-on-startup' servlet is re-executed, and freeze when public key is
> reading ...
> and in my catalina.out i find this :
> 
> java.security.NoSuchAlgorithmException: Algorithm ElGamal not available
>          at javax.crypto.SunJCE_b.a(DashoA6275)
>          at javax.crypto.Cipher.getInstance(DashoA6275)
>          at cryptix.openpgp.algorithm.PGPElGamal.<init>(PGPElGamal.java:91)
>          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>          at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>          at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>          at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>          at java.lang.Class.newInstance0(Class.java:296)
>          at java.lang.Class.newInstance(Class.java:249)
>          at
> cryptix.openpgp.algorithm.PGPAlgorithmFactory.getPublicKeyAlgorithm(PGPAlgorithmFactory.java:445)
>          at
> cryptix.openpgp.packet.PGPKeyPacket.decodePublicData(PGPKeyPacket.java:228)
>          at
> cryptix.openpgp.packet.PGPPublicSubKeyPacket.decodeBody(PGPPublicSubKeyPacket.java:92)
>          at
> cryptix.openpgp.packet.PGPPacketFactory.readPacket(PGPPacketFactory.java:253)
>          at
> cryptix.openpgp.provider.PGPKeyBundleFactory.helper(PGPKeyBundleFactory.java:84)
>          at
> cryptix.openpgp.provider.PGPMessageFactory.generateBinary(PGPMessageFactory.java:224)
>          at
> cryptix.openpgp.provider.PGPMessageFactory.generateAscii(PGPMessageFactory.java:157)
>          at
> cryptix.openpgp.provider.PGPMessageFactory.engineGenerateMessages(PGPMessageFactory.java:77)
>          at
> cryptix.message.MessageFactory.generateMessages(MessageFactory.java:142)
>          at pkg.SetupServlet.init(SetupServlet.java:54)
>          at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
>          at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
>          at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3420)
>          at
> org.apache.catalina.core.StandardContext.reload(StandardContext.java:2567)
>          at
> org.apache.catalina.loader.WebappLoader$WebappContextNotifier.run(WebappLoader.java:1369)
>          at java.lang.Thread.run(Thread.java:536)
> 
> so initialisation failed and i have to restart tomcat manually (so all
> other web applications in the container)
> 
> someone can help me ?

I hope I can...

What JDK version are you using, 1.3 or 1.4? 1.4 didn't like it when I
had a "Security.addProvider()" line in my code. You might check out the
cryptography forum at http://forums.java.com  - that was VERY helpful to
me.

-- 
Lynn Hollerman.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to