Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

KeyGenerator or Jar Signing issue

145 views
Skip to first unread message

mattvenn

unread,
Jun 8, 2005, 9:50:17 AM6/8/05
to
I have a function add a JCE provider for an AES algorithm, but the JCE
fails every time I attempt to launch it.

Provider jceProvider = new com.x.jce.provider.JCEProvider;
Security.addProvider (jceProvider);
Provider [] currentProviders = Security.getProviders();
// ... code to print the array removed
SecureRandom rand = SecureRandom.getInstance("SHA1PRNG",
"JceProvider");
//psuedo random number generator
KeyGenerator aesKeyGen = KeyGenerator.getInstance("AES","JceProvider");

The SecureRandom getInstance function works fine, but the KeyGenerator
getInstance function fails with the following error:

[java] java.security.NoSuchProviderException: JCE cannot authenticate
the provider JceProvider
[java] at javax.crypto.SunJCE_b.a(DashoA6275)
[java] at javax.crypto.SunJCE_b.a(DashoA6275)
[java] at javax.crypto.KeyGenerator.getInstance(DashoA6275)
[java] at com.x.jce.AES.go(Unknown Source)
[java] at com.x.jce.AES.main(Unknown Source)
[java] Caused by: java.util.jar.JarException: file:/jceProvider.jar is
not signed by a trusted signer.
[java] at javax.crypto.SunJCE_d.b(DashoA6275)
[java] at javax.crypto.SunJCE_d.a(DashoA6275)
[java] at javax.crypto.SunJCE_d.a(DashoA6275)
[java] at javax.crypto.SunJCE_b.b(DashoA6275)
[java] ... 5 more

Any ideas why the KeyGenerator would fail but the SecureRandom (which
looks for the same exact provider) fails? I've attempted to sign the
jars with self-signed certificates. Verifying the signatures always
returns true. I am completely stumped.

Thanks in advance for any help.
-Matt

dala

unread,
Jun 15, 2005, 5:35:15 AM6/15/05
to
Hi,

You must sign your JCE provider JAR file using a code signing
certificate issued by Sun Microsystems, see step 5a in
http://java.sun.com/j2se/1.5.0/docs/guide/security/jce/HowToImplAJCEProvider.html

You cannot use a self-signed certificate when you implement (extends)
the abstract SPI classes that resides in the javax.crypto.* package.
For example you'll get same error when extending the class
javax.crypto.CipherSpi.

Regards,
Tommy Grandefors

0 new messages