Sun JCE Provider
843810Feb 2 2004 — edited Aug 31 2006Hi,
I'm a relative newbie to the JCE and am having some trouble. I have already searched multiple forums including this one for a solution.
version = j2sdk1.4.2_03
platform = windoze
Here is the code:
Security.addProvider(new SunJCE());
logger.debug("Creating keyGenerator object");
javax.crypto.KeyGenerator keyGenerator =
javax.crypto.KeyGenerator.getInstance("DES","SunJCE");
This generates a fatal exception with the following info:
java.security.NoSuchProviderException: JCE cannot authenticate the provider SunJCE
at javax.crypto.SunJCE_b.a(DashoA6275)
at javax.crypto.SunJCE_b.a(DashoA6275)
at javax.crypto.KeyGenerator.getInstance(DashoA6275)
at com.austinenergy.core.KeyGenerator.executeStatement(KeyGenerator.java:114)
at com.austinenergy.core.KeyGenerator.main(KeyGenerator.java:97)
Caused by: java.lang.NullPointerException
To date I have attempted the following:
- downloaded the unrestricted JCE jar files
- modified my %java_home%/jre/lib/security/java.security file in order to place
security.provider.1=com.sun.crypto.provider.SunJCE (read that might help somewhere)
Seems like this should be a simple thing but then I have to remember this is Java. What am I doing wrong and what can I do to fix? Please do not respond with a link to any docs... would prefer sample code.
Thanks in advance