[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[iaik-jce] Problems with DESKeyGenerator
Hello,
I'm using iaik_jce_full_ssl_applet.jar version 2.0 (I think...) and I
have a strange problem... the compiler doesn't complain at all, but at
runtime I have an exception:
Exception occurred during event dispatching:
java.lang.NoClassDefFoundError: iaik/security/cipher/DESKeyGenerator
at ProvaCifra.action(Compiled Code)
at java.awt.Component.handleEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.dispatchEventImpl(Compiled Code)
at java.awt.Component.dispatchEvent(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)
What does it mean?
I need this library for my thesis.... :)
Thank you very much...
Riccardo Conturbia
Ah... the source is the following:
/*******************************************************************/
// Prova di applet che cifra
import javax.crypto.Cipher;
import javax.crypto.spec.*;
import javax.crypto.SecretKey;
import java.awt.*;
import iaik.security.cipher.DESKeyGenerator;
public class ProvaCifra extends java.applet.Applet
{
GridLayout gl = new GridLayout(2,2);
Button cifra = new Button("Cifra");
Button decifra = new Button("Decifra");
TextArea plainText = new TextArea(5, 50);
TextArea cryptedText = new TextArea(5, 50);
public void init()
{
setLayout(gl);
add(plainText);
cryptedText.setEditable(false);
add(cryptedText);
add(cifra);
add(decifra);
}
public boolean action (Event evt, Object arg)
{
if (evt.target.equals(cifra))
{
try
{
DESKeyGenerator DESKeyGen = new DESKeyGenerator();
SecretKey DESKey = DESKeyGen.engineGenerateKey();
Cipher c = Cipher.getInstance("DES");
c.init(Cipher.ENCRYPT_MODE, DESKey);
cryptedText.setText(String.valueOf(c.doFinal(plainText.getText().getBytes())));
}
catch (Exception e)
{
System.out.println("uh oh... " + e.getMessage());
}
}
else if (evt.target.equals(decifra))
{
}
else return super.action(evt, arg);
return true;
}
}
--
Mailinglist-archive at http://jcewww.iaik.tu-graz.ac.at/mailarchive/iaik-jce/maillist.html
To unsubscribe send an email to listserv@iaik.tu-graz.ac.at with the folowing content: UNSUBSCRIBE iaik-jce