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

[iaik-jce] Exception in applet when creating IAIK Provider



Hello,

I am using IAIK applet edition 2.51, running the applet under Netscape
4.7 (which has the Java 1.1.5 JVM).  I am trying to create and add the
IAIK provider in the init method.

In short, I get an exception at runtime at the line
       iaik.security.provider.IAIK iaikProvider =
                     new iaik.security.provider.IAIK();
when  iaik.security.provider.IAIK constructor invokes
java.security.Provider.put.  My code does not even get to the line
      iaik.java.security.Security.addProvider(iaikProvider);

My understanding was that using iaik.java.security.* classes in an
applet would avoid invoking java.security.*

What is the proper syntax to add the IAIK provider in an applet?  This
is crucial to my delivering a customer solution, and prompt response
would be appreciated.

Here is a simple applet testProvider.java that exhibits this problem on
my system.
A netscape.security.AppletSecurityException is thrown when the applet is
run.
                   *****                file  testProvider.java
follows        ******
import java.applet.*;
import java.awt.*;
import java.io.*;

public class testProvider extends Applet
{

  public void init()
  {
    System.out.println("Entered testProvider.init");
    try{
      System.out.println("Before creating provider");
      iaik.security.provider.IAIK iaikProvider =
                     new iaik.security.provider.IAIK();
      System.out.println("After creating provider");
      iaik.java.security.Security.addProvider(iaikProvider);
      System.out.println("After adding provider");
    }
    catch (Exception e){
      e.printStackTrace();
      return;
    }
  }

  public void paint(Graphics g)
  {
    g.drawString("Hello world!", 50, 25);
  }
}

I compile this applet using the following command:
javac -classpath
e:\jbuilder3\java\jre\lib\rt.jar;e:\iaik\iaik2.51_ae\lib\iaik_jce_full_ae.jar

The applet compiles fine.
The html file that invokes the applet, called testProvider.html,  is as
follows:
                   *****                file  testProvider.html
follows          ******

<html>
<head>
   <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
   <meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; I)
[Netscape]">
   <meta http-equiv="Program" cache="nocache">
   <title>Testing Adding a Provider
</title>
</head>
<body>
Use this page to test adding a provider<BR><BR>
<APPLET archive="iaik_jce_full_ae.jar" code="testProvider.class"
WIDTH="500" HEIGHT="300">
</APPLET>
</form>
</body>
</html>

When I run the applet from a Netscape window, I receive the output
"Hello world!" but the Java console shows the following exception:

Netscape Communications Corporation -- Java 1.1.5
Type '?' for options.
Symantec Java! ByteCode Compiler Version 210.065
Copyright (C) 1996-97 Symantec Corporation
Entered testProvider.init
Before creating provider
Error: 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 testProvider.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 Grenadir




--
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