jsdsi.util
Class DigestUtils

java.lang.Object
  extended byjsdsi.util.DigestUtils

public class DigestUtils
extends java.lang.Object

Utility class for MessageDigests

Version:
$Revision: 1.4 $ $Date: 2004/11/08 12:08:08 $
Author:
Sean Radford

Method Summary
static java.security.MessageDigest getDigest(DigestAlgoEnum digest)
          Return a java.security.MessageDigest
static java.security.MessageDigest getDigest(DigestAlgoEnum digest, java.lang.String provider)
          Return a java.security.MessageDigest
static byte[] md5(byte[] bytes)
          Calculate and return the MD5 digest of the given data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDigest

public static java.security.MessageDigest getDigest(DigestAlgoEnum digest)
Return a java.security.MessageDigest

Parameters:
digest - a DigestAlgoEnum representing the type of digest sought
Returns:
the MessageDigest
Throws:
JsdsiRuntimeException - on error

getDigest

public static java.security.MessageDigest getDigest(DigestAlgoEnum digest,
                                                    java.lang.String provider)
Return a java.security.MessageDigest

Parameters:
digest - a DigestAlgoEnum representing the type of digest sought
provider - the Provider to use
Returns:
the MessageDigest
Throws:
JsdsiRuntimeException - on error

md5

public static byte[] md5(byte[] bytes)
Calculate and return the MD5 digest of the given data

Parameters:
bytes - data to digest
Returns:
the digest


Copyright © 2002-2006 JSDSI. All Rights Reserved.