kiran wrote:

>how to use JSS to do checksum operation using MD5 ?
>I have to do the encryption and also the checksum kind of operation. I
>wanted to use MD5 to get the hash of some information and wanted to make
>sure that info wasn't tampered with. I was looking for some kind of code
>samples or how to use.
>
>Thanks
>Kiran
>
You don't need to use JSS if all you are doing is MD5 digests. It is 
much easier to just use the java.security.MessageDigest class included 
with the JDK.

If you do want to use JSS, the best way to do it is to use the JCA API 
with JSS as the implementation provider. Some examples of this can be 
found in:

http://lxr.mozilla.org/mozilla/source/security/jss/org/mozilla/jss/tests/DigestTest.java

This program does some other things you don't need to do. The most 
important things you need to do are:

1. Initialize CryptoManager (line 59)
2. Get a MessageDigest instance with the JSS provider ( line 70)
3. Call digest() on the MessageDigest object.


Reply via email to