# Re: JCE example question

Jan Luehe (Jan.Luehe@eng.sun.com)
Mon, 22 Mar 1999 13:03:17 -0800 (PST)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Roger Gibson: "Internet Wire: Game News"
- Previous message: Ravindra B. Nagaraju: "applet and DLLs."
- Maybe in reply to: Paul Irwin: "JCE example question"

    Message-Id: <199903222103.NAA03190@laguna.eng.sun.com>

    Date: Mon, 22 Mar 1999 13:03:17 -0800 (PST)

    From: Jan Luehe <Jan.Luehe@eng.sun.com>

    Subject: Re: JCE example question

    To: java-security@java.sun.com, plirwin@gis.net

Paul:

> I've been trying out JCE 1.2 by using the PBE example supplied with the
> documentation. However when I use the generateSecret method it keeps
> throwing the InvalidKeySpecException. Attached is my code. Any help
> would be appreciated.

Sorry, I cannot reproduce your problem. I added an init()
method to your applet, and moved all your code into that
method. Everything worked fine.

Can you send me more details like:

1. Are you bundling JCE with your applet, or is
JCE provided as an installed extension in the
jre/lib/ext directory of your JRE installation?
2. You applet has a single method "Encryption". Who
calls that?

It looks like you have not configured JCE correctly.
The exception that you see is only thrown when you pass
a key specification that is not an instance of
javax.crypto.spec.PBEKeySpec to the PBE key factory's
"generateSecret" method.

Jan

- Next message: Roger Gibson: "Internet Wire: Game News"
- Previous message: Ravindra B. Nagaraju: "applet and DLLs."
- Maybe in reply to: Paul Irwin: "JCE example question"