[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-jce] AppletSecurityException adding IAIK provider



Hi,

I am writing an applet to run in a browser window.  It reads and writes
files on the user's drive and it uses IAIK implementation of ciphers.
When I add the IAIK provider, I get an AppletSecurityException
security.security operation: putProviderProperty.IAIK. What should I be
doing?

Note, I am compiling with the IAIK Applet Edition and including the
classes from the Applet edition in the jar file archive with the
applet.  I forgot to include the classes from your jdk11x_upadate.jar in
the archive with my applet (the JVM in the browser is 1.1) but that
should not affect this problem.

In the init() method of the applet I invoke
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileAccess");()
to allow the browser to ask the user to grant permission to the applet
for read/write of files.   I added capsapi_classes.zip from Netscape to
my CLASSPATH for compiling with the Capabilities classes.

The code in my init() method is as follows:

public void init()
  {
    try{
      PrivilegeManager.enablePrivilege("UniversalFileAccess");
    }
    catch (netscape.security.ForbiddenTargetException e) {
      System.out.println("Permission for UniversalFileAccess denied by
user");
      return;
    }
    catch (Exception e){
      System.out.println("Applet failed when enabling privilege
UniversalFileAccess");
      e.printStackTrace();
      return;
    }
    try{
      iaik.security.provider.IAIK.addAsProvider();
    }
    catch (Exception e){
      System.out.println("Error adding IAIK provider: " + e.toString());

      e.printStackTrace();
      return;
    }

At run, time, after the user clicks "Grant" for permission to read/write
files, I get the following exception:

Error adding IAIK provider: netscape.security.AppletSecurityException:
security.security operation: putProviderProperty.IAIK

netscape.security.AppletSecurityException: security.security operation:
putProviderProperty.IAIK
  at java.lang.Throwable.<init>(Compiled Code)
  at java.lang.Exception.<init>(Compiled Code)
  at java.lang.RuntimeException.<init>(Compiled Code)
  at java.lang.SecurityException.<init>(Compiled Code)
  at netscape.security.AppletSecurityException.<init>(Compiled Code)
  at netscape.security.AppletSecurityException.<init>(Compiled Code)
  at netscape.security.AppletSecurity.checkSecurityAccess(Compiled Code)

  at java.security.Provider.check(Compiled Code)
  at java.security.Provider.put(Compiled Code)
  at iaik.security.provider.IAIK.<init>(Compiled Code)
  at iaik.security.provider.IAIK.addAsProvider(Compiled Code)
* at iaik.security.provider.IAIK.addAsProvider(Compiled Code)
  at myApplet.init(Compiled Code)
  at
netscape.applet.DerivedAppletFrame$InitAppletEvent.dispatch(Compiled
Code)
  at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled
Code)
  at java.awt.EventDispatchThread.run(Compiled Code)
  at
netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
Code)


Thanks in advance,
Alan

--
Mailinglist-archive at http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html

To unsubscribe send an email to listserv@iaik.at with the folowing content: UNSUBSCRIBE iaik-jce