|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.n52.security.common.crypto.DigestUtil
public final class DigestUtil
Class DigestUtil contains some convenient utility methods related to
MessageDigest
tasks.
Method Summary | |
---|---|
static char[] |
digestToCharArray(byte[] digest)
Method digestToCharArray converts a byte[] message digest to its two digit hexdecimal representation as chars. |
static java.lang.String |
digestToString(byte[] digest)
Method digestToString converts a byte[] message digest to its two digit hexdecimal representation as string. |
static boolean |
isDigestOf(byte[] digest,
int expectedSize)
Method isDigestOf test if the given byte[] array is a digest. |
static boolean |
isDigestOf(byte[] digest,
java.security.MessageDigest algorithm)
Method isDigestOf test if the given byte[] array is a digest. |
static boolean |
isDigestOf(byte[] digest,
java.lang.String algorithm)
Method isDigestOf test if the given byte[] array is a digest. |
static boolean |
isDigestOf(char[] digest,
int expectedSize)
Method isDigestOf test if the given char[] array is a digest. |
static boolean |
isDigestOf(char[] digest,
java.security.MessageDigest algorithm)
Method isDigestOf test if the given char[] array is a digest. |
static boolean |
isDigestOf(char[] digest,
java.lang.String algorithm)
Method isDigestOf test if the given char[] array is a digest. |
static boolean |
isDigestOf(java.lang.String digest,
int expectedSize)
Method isDigestOf test if the given String is a digest. |
static boolean |
isDigestOf(java.lang.String digest,
java.security.MessageDigest algorithm)
Method isDigestOf test if the given char[] array is a digest. |
static boolean |
isDigestOf(java.lang.String digest,
java.lang.String algorithm)
Method isDigestOf test if the given char[] array is a digest. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String digestToString(byte[] digest)
digest
- the digest !=null.
public static char[] digestToCharArray(byte[] digest)
digest
- the digest !=null.
public static boolean isDigestOf(byte[] digest, int expectedSize)
digest
- the digest !=nullexpectedSize
- the expectedSize.
public static boolean isDigestOf(char[] digest, int expectedSize)
digest
- the digest !=null.expectedSize
- the expectedSize of the digest in bytes as given by the algoritm
MessageDigest.getDigestLength()
Therewith this is the size in bytes, not the size of the char array,
e.g. MD5 has a size of 16, and the char[] is tested for a length of 32.
public static boolean isDigestOf(java.lang.String digest, int expectedSize)
digest
- the digest !=null.expectedSize
- the expectedSize of the digest in bytes as given by the algoritm
MessageDigest.getDigestLength()
Therewith this is the size in bytes, not the size of the String,
e.g. MD5 has a size of 16, and the String is tested for a length of 32.
public static boolean isDigestOf(byte[] digest, java.security.MessageDigest algorithm)
digest
- the digest !=null.algorithm
- the algorithm !=null.
public static boolean isDigestOf(char[] digest, java.security.MessageDigest algorithm)
digest
- the digest !=null.algorithm
- the algorithm !=null.
public static boolean isDigestOf(java.lang.String digest, java.security.MessageDigest algorithm)
digest
- the digest !=null.algorithm
- the algorithm !=null.
public static boolean isDigestOf(byte[] digest, java.lang.String algorithm) throws java.security.NoSuchAlgorithmException
digest
- the digest !=null.algorithm
- the algorithm !=null.
java.security.NoSuchAlgorithmException
- if algorithm not supported.public static boolean isDigestOf(char[] digest, java.lang.String algorithm) throws java.security.NoSuchAlgorithmException
digest
- the digest !=null.algorithm
- the method !=null.
java.security.NoSuchAlgorithmException
- if algorithm not supported.public static boolean isDigestOf(java.lang.String digest, java.lang.String algorithm) throws java.security.NoSuchAlgorithmException
digest
- the digest !=null.algorithm
- the method !=null.
java.security.NoSuchAlgorithmException
- if algorithm not supported.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |