|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.security.auth.spi.Util
public class Util
Common login module utility methods
Field Summary | |
---|---|
static String |
BASE16_ENCODING
|
static String |
BASE64_ENCODING
|
static String |
RFC2617_ENCODING
|
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static String |
createPasswordHash(String hashAlgorithm,
String hashEncoding,
String hashCharset,
String username,
String password)
Calculate a password hash using a MessageDigest. |
static String |
createPasswordHash(String hashAlgorithm,
String hashEncoding,
String hashCharset,
String username,
String password,
DigestCallback callback)
Calculate a password hash using a MessageDigest. |
static String |
encodeBase16(byte[] bytes)
Hex encoding of hashes, as used by Catalina. |
static String |
encodeBase64(byte[] bytes)
BASE64 encoder implementation. |
static String |
encodeRFC2617(byte[] data)
3.1.3 Representation of digest values An optional header allows the server to specify the algorithm used to create the checksum or digest. |
static byte[] |
fromb64(String str)
|
static String |
tob64(byte[] buffer)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String BASE64_ENCODING
public static final String BASE16_ENCODING
public static final String RFC2617_ENCODING
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static String createPasswordHash(String hashAlgorithm, String hashEncoding, String hashCharset, String username, String password)
hashAlgorithm
- - the MessageDigest algorithm namehashEncoding
- - either base64 or hex to specify the type of
encoding the MessageDigest as a string.hashCharset
- - the charset used to create the byte[] passed to the
MessageDigestfrom the password String. If null the platform default is
used.username
- - ignored in default versionpassword
- - the password string to be hashed
public static String createPasswordHash(String hashAlgorithm, String hashEncoding, String hashCharset, String username, String password, DigestCallback callback)
hashAlgorithm
- - the MessageDigest algorithm namehashEncoding
- - either base64 or hex to specify the type of
encoding the MessageDigest as a string.hashCharset
- - the charset used to create the byte[] passed to the
MessageDigestfrom the password String. If null the platform default is
used.username
- - ignored in default versionpassword
- - the password string to be hashedcallback
- - the callback used to allow customization of the hash
to occur. The preDigest method is called before the password is added
and the postDigest method is called after the password has been added.
public static String encodeRFC2617(byte[] data)
data
- - the raw MD5 hash data
public static String encodeBase16(byte[] bytes)
public static String encodeBase64(byte[] bytes)
public static String tob64(byte[] buffer)
public static byte[] fromb64(String str) throws NumberFormatException
NumberFormatException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |