org.apache.catalina.util
Class ConcurrentMessageDigest
java.lang.Object
org.apache.catalina.util.ConcurrentMessageDigest
public class ConcurrentMessageDigest
- extends java.lang.Object
A thread safe wrapper around MessageDigest
that does not make use
of ThreadLocal and - broadly - only creates enough MessageDigest objects
to satisfy the concurrency requirements.
Method Summary |
static byte[] |
digest(java.lang.String algorithm,
byte[] input)
|
static byte[] |
digestMD5(byte[] input)
|
static void |
init(java.lang.String algorithm)
Ensures that digest(String, byte[]) will support the specified
algorithm. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
digestMD5
public static byte[] digestMD5(byte[] input)
digest
public static byte[] digest(java.lang.String algorithm,
byte[] input)
init
public static void init(java.lang.String algorithm)
throws java.security.NoSuchAlgorithmException
- Ensures that
digest(String, byte[])
will support the specified
algorithm. This method must be called and return successfully
before using digest(String, byte[])
.
- Parameters:
algorithm
- The message digest algorithm to be supported
- Throws:
java.security.NoSuchAlgorithmException
- If the algorithm is not supported by the
JVM
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.