|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.cafesoft.core.util.DigestString
DigestString represents a String value that may or may not
have been transformed by a "one way hash" algorithm, usually called a
"message digest". If the String is "digested", it's standard form is:
{algorithm}(digestvalue[salt])
where:
| Constructor Summary | |
DigestString(String digestString)
Create a new DigestString. |
|
| Method Summary | |
static String |
createDigestString(String s,
String algorithm)
Returns a digest of the strValue based on the specified alogrithm. |
static String |
createDigestString(String strValue,
String algorithm,
byte[] salt)
Return a digestString without an algorithm label. |
static String |
createDigestString(String strValue,
String algorithm,
byte[] salt,
String label)
Return a digestString with an algorithm label. |
String |
getAlgorithm()
Return the algorithm of this DigestString. |
String |
getDigest()
Return the digest of this DigestString. |
int |
getDigestSize()
Return the length of this DigestString. |
String |
getLabel()
Return the algorithm label of this DigestString. |
byte[] |
getSalt()
Return the salt of this DigestString. |
boolean |
isDigestString()
If a label prefix indicating the digest algorithm does not exist, then we cannot determine the digest algorithm (or the digest string is clear text). |
boolean |
isEqual(String cleartext)
Determine if a cleartext value is the same a as suspect DigestString. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DigestString(String digestString)
digestString - the "possibly" digestString from which the
DigestString will be constructed.| Method Detail |
public boolean isDigestString()
getDigest()public String getDigest()
public int getDigestSize()
public String getAlgorithm()
isDigestString()public String getLabel()
isDigestString()public byte[] getSalt()
public static String createDigestString(String strValue,
String algorithm,
byte[] salt)
throws NoSuchAlgorithmException
strValue - the String value to hashalgorithm - the digest algorithm to be appliedsalt - the random "salt" bytes
NoSuchAlgorithmException - if the digest algorithm is not
registered with the Java Security Provider Interface.
public static String createDigestString(String strValue,
String algorithm,
byte[] salt,
String label)
throws NoSuchAlgorithmException
strValue - the string value to hashalgorithm - the digest algorithm to be appliedsalt - the random "salt" byteslabel - the digest string algorithm prefix (e.g., {CRYPT})
NoSuchAlgorithmException - if the digest algorithm is not
registered with the Java Security Provider Interface.
public static String createDigestString(String s,
String algorithm)
s - The String to be digestedalgorithm - The algorithm to use: Clear Text, SSHA, SHA,
SMD5 and MD5 are supported.public boolean isEqual(String cleartext)
cleartext - The cleartext value to compare to the
suspect DigestString.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||