# Re: Trying to write a Provider

Jan Luehe (Jan.Luehe@Eng)
Wed, 15 Jul 1998 12:18:14 -0700 (PDT)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Jan Luehe: "Re: java security import"
- Previous message: Ian P. Monsch: "Running signed applets in the sun activator"
- Maybe in reply to: CAllen@symantec.com: "Trying to write a Provider"

    Date: Wed, 15 Jul 1998 12:18:14 -0700 (PDT)

    From: Jan Luehe <Jan.Luehe@Eng>

    Subject: Re: Trying to write a Provider

    To: java-security@java.Sun.COM, CAllen@symantec.com

Chris:

> If I am reading this correctly, then to get an instance of something,
> the object has to be a subclass of something in the java.security
> package. However, KeyGenerator and Cipher are in the javax.crypto
> package, so I do not see any way to get this to work.

Note that there is a package-private class "JceSecurity.java"
in javax.crypto which instantiates your provider's
JCE implementation classes, i.e., implementations of
JCE engine classes are not instantiated via "java.security.Security".

In javax.crypto.JceSecurity, the following check is made:

Class typeClass = Class.forName("javax.crypto." + engineType
+ "Spi");
if (checkSuperclass(implClass, typeClass)) {
// Instantiate the SPI implementation
Object obj = implClass.newInstance();

> However, the DES cipher works just fine, even though it comes with the
> javax.crypto package, so I know that you can use other packages.

Do your provider classes subclass off of "Spi" classes? If not,
that would explain why you're getting the exception.

> The "How to implement a Provider" document does not mention a solution
> for this, as far as I can tell.

The upcoming JCE 1.2 beta release will include a separate provider guide
that will explain in much detail how to write a provider for JCE.

Jan

- Next message: Jan Luehe: "Re: java security import"
- Previous message: Ian P. Monsch: "Running signed applets in the sun activator"
- Maybe in reply to: CAllen@symantec.com: "Trying to write a Provider"