Date: Tue, 4 Mar 1997 14:58:33 -0800
Message-Id: <199703042258.OAA10941@puffin.eng.sun.com>
From: Marianne Mueller <mrm@eng.sun.com>
To: ajay@pa.dec.com
Subject: On creating a provider
Hi Ajay,
Your steps for creating a provider look correct.
The only thing you should do, in addition, is
Call the superclass constructor with the name of your
algorithm, as a string
I realize this seems somewhat redundant, but, leave that
aside for now. This is the right way to use
Signature and MessageDigest.
Don't worry that getAlgorithm() returns null - if you call the
superclass constructor then getAlgorithm() should do the right thing.
> 1. I have created a provider subclass to add my new provider. This new subclass
> of the prvider provides all the basic functions as needed in the API.
> In addition, in the constructorfor my provider , I list my new message
> digest algorithm as
>
> put("MessageDigest.HMAC", "HMAC");
>
> Moreover my HMAC class is written as subclass of MessageDigest.
>
> My new provider dec.java as well as HMAC.java are in the current directory
> so that these classes can always be found.
>
> 2. I have modified the ../lib/security/java.security file to declare my
> new provider declaring the masterclass of my new provider.
>
> 3. I have written a small test program to find all the new provider and
> then return a instance of the MessageDigest algo for HMAC. I am able to
> find my both the provider. When I return my new HMAC instance and then try
> to find the algorithm by using the getAlgorithm(), it returns me null. I try
> the same thing with MD5, it works fine, returning me name of algorithm as
> MD5.