# Re: Exception while generating keys in applets

Charlie Lai (charlie@angeles.eng.sun.com)
Tue, 17 Nov 1998 15:17:13 -0800 (PST)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Charlie Lai: "Re: Applet Security"
- Previous message: Omar Ba_rukab: "Re: JavaWebServer SSL Question"

hi,

> 2) create the keys in the applet. I've tried this, it worked in a very
> simple applet (just an init method doing the key generation), but it
> doesn't work with a more complicated applet (i.e. a few buttons, labels and
> an ActionListener). When I try to generate the keys, I get the following
> (everything JDK 1.2 beta4, appletviewer):
>
>
> Exception occurred during event dispatching.
> java.lang.ExceptionInInitializerError:
> java.security.AccessControlException: access denied
> (java.lang.RuntimePermission modifyThread)
> ...
> at sun.security.provider.genSeed(SeedGenerator.java:161)
> at sun.security.provider.setSleepTime(SeedGenerator.java:60)
> ...
> at
> sun.security.provider.DSAKeyPairGenerator.generateKeyPair(DSAKeyPairGenerat
> or.java:161)
> ...
> the event (a push to a button), that should initiate the key generation
> (something like onButtonBushed())
>
> Now, when I generate the keys outside of an event, for example in the init
> method of the applet, it works fine. Is this a bug, or expected?

i'm not sure exactly what the problem might be.
however the final version of JDK 1.2 has a new SeedGenerator
implementation, so you shouldn't run into this problem anymore.

thanks,
charlie

- Next message: Charlie Lai: "Re: Applet Security"
- Previous message: Omar Ba_rukab: "Re: JavaWebServer SSL Question"