# Re[2]: Trying to write a Provider

CAllen@symantec.com
Wed, 15 Jul 1998 13:24:40 -0700

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Jan Luehe: "Re: Re[2]: Trying to write a Provider"
- Previous message: Jan Luehe: "Re: java security import"
- Next in thread: Jan Luehe: "Re: Re[2]: Trying to write a Provider"

    From: CAllen@symantec.com

    Date: Wed, 15 Jul 1998 13:24:40 -0700

    To: java-security@java.Sun.COM, Jan Luehe <Jan.Luehe@Eng>

    Subject: Re[2]: Trying to write a Provider

--IMA.Boundary.4824350090
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Description: cc:Mail note part

Wow, what a quick response. Thanks for explaining about the check that
JceSecurity.class makes; that little mystery had me going around is
circles for awhile.
However, I am supplying Spi classes, with the correct names, as far as
I can tell. For instance, I have the following classes for the
KeyGenerator:
public final class XORKeyGeneratorSpi extends KeyGeneratorSpi
public final class XORKeyGenerator extends KeyGenerator
public final class XORKey implements SecretKey
For the Cipher classes, I have:
public final class XORspi extends javax.crypto.CipherSpi
public final class XOR extends javax.crypto.Cipher
I looked at how the Sun provider named the DES classes, and tried to
follow the same format. Could the names themselves be causing the
problem?
Thanks
Chris Allen
callen@symantec.com

______________________________ Reply Separator _________________________________
Subject: Re: Trying to write a Provider
Author: Jan Luehe <Jan.Luehe@Eng.Sun.COM> at Internet
Date: 7/15/98 12:18 PM

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
--IMA.Boundary.4824350090
Content-Type: text/plain; charset=US-ASCII; name="RFC822 message headers"
Content-Transfer-Encoding: 7bit
Content-Description: cc:Mail note part
Content-Disposition: inline; filename="RFC822 message headers"

Received: from mailer.Symantec.Com ([198.6.49.176]) by smtp-ima.symantec.com
with SMTP
(IMA Internet Exchange 3.0 Enterprise) id 0013766D; Wed, 15 Jul 98 12:15:41
-0700
Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1])
by mailer.Symantec.Com (8.8.8/8.8.8) with SMTP id MAA05859
for <CAllen@symantec.com>; Wed, 15 Jul 1998 12:17:45 -0700 (PDT)
Received: from Eng.Sun.COM (engmail4 [129.144.134.6]) by mercury.Sun.COM
(SMI-8.6/mail.byaddr) with SMTP id MAA10211 for <CAllen@symantec.com>; Wed, 15
Jul 1998 12:18:28 -0700
Received: from shorter.eng.sun.com (shorter.Eng.Sun.COM [129.144.174.35])
by Eng.Sun.COM (SMI-8.6/SMI-5.3) with SMTP id MAA11923;
Wed, 15 Jul 1998 12:18:19 -0700
Received: from laguna.eng.sun.com by shorter.eng.sun.com (SMI-8.6/SMI-SVR4)
id MAA08902; Wed, 15 Jul 1998 12:18:19 -0700
Received: from laguna by laguna.eng.sun.com (SMI-8.6/SMI-SVR4)
id MAA27932; Wed, 15 Jul 1998 12:18:14 -0700
Date: Wed, 15 Jul 1998 12:18:14 -0700 (PDT)
From: Jan Luehe <Jan.Luehe@Eng.Sun.COM>
Reply-To: Jan Luehe <Jan.Luehe@Eng.Sun.COM>
Subject: Re: Trying to write a Provider
To: java-security@java.Sun.COM, CAllen@symantec.com
Message-ID: <libSDtMail.9807151218.11730.luehe@shorter>
MIME-Version: 1.0
Content-Type: TEXT/plain; charset=us-ascii
Content-MD5: YG8SFik/MmaHyjcSugNrgg==
X-Mailer: dtmail 1.1.0 CDE Version 1.1 SunOS 5.5.1 sun4u sparc
--IMA.Boundary.4824350090--

- Next message: Jan Luehe: "Re: Re[2]: Trying to write a Provider"
- Previous message: Jan Luehe: "Re: java security import"
- Next in thread: Jan Luehe: "Re: Re[2]: Trying to write a Provider"