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

[iaik-jce] Problems loading an applet



I downloaded yesterday the IAIK JCE for Applets API evaluation license
(iaik_jce_full_ae.jar), in order to be able to encrypt some data in it and
send the data back to my server, but I've got experience some problems when
the browses loads the applet.

The applet imports  the iaiq.security...and other iaiq packages, the applet
is not compiled optimized and i've got the applets and the other classes in
a jar archive located in the codebase TAG of the applet.

This is the text displayed in Navigator 4.72 :


////////////////////////////////////////////////////////////////////

Netscape Communications Corporation -- Java 1.1.5 Type '?' for options.
Symantec Java! ByteCode Compiler Version 210.065
Copyright (C) 1996-97 Symantec Corporation
# Verifier error Envio.encriptar(Ljava/lang/String;)   Ljava/lang/String;:
Cannot find class java/security/Key
# Applet exception: class Envio got a security violation: method
verification error
java.lang.VerifyError: Envio   at
java.lang.ClassLoader.resolveClass(Compiled Code)   at
netscape.applet.AppletClassLoader.loadClass1(Compiled Code) * at
netscape.applet.AppletClassLoader.loadClass(Compiled Code)   at
netscape.applet.AppletClassLoader.loadClass(Compiled Code)   at
netscape.applet.DerivedAppletFrame$LoadAppletEvent.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)

///////////////////////////////////////////////////////////////////

This is part of the soure code of the applet:

import javax.crypto.spec.*;
import javax.crypto.*;
import iaik.java.security.*;
import iaik.java.security.acl.*;
import iaik.java.security.cert.*;
import iaik.java.security.interfaces.*;
import iaik.java.security.spec.*;
import iaik.security.*;
import iaik.java.util.*;

	iaik.java.security.Security.addProvider(new iaik.security.provider.IAIK());

	Cipher rc2Cipher;

	byte[] rc2KeyByte;
      SecretKey rc2Key= null;
	String cad_encriptada=null;
      String keyStr = null;
      keyStr= "hola";
      MessageDigest hash = MessageDigest.getInstance("MD5");
      rc2KeyByte = new byte[16];
	System.arraycopy(hash.digest(keyStr.getBytes()), 0, rc2KeyByte, 0, 16);
	rc2Key = (SecretKey)new SecretKeySpec(rc2KeyByte, "RC2");
      rc2Cipher = Cipher.getInstance("RC2");
      rc2Cipher.init(Cipher.ENCRYPT_MODE, rc2Key);
      byte[] mensaje = cadena.getBytes();
      byte[] resultado = null;
	resultado = rc2Cipher.doFinal(mensaje);

Does anyone know what the problem could be ???? Any sample code ????

Thank you,

Andres.







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