com.wowza.util
Class MD5DigestUtils

Object
  extended by com.wowza.util.MD5DigestUtils

public class MD5DigestUtils
extends Object

MD5DigestUtils: MD5 hash utilities.


Field Summary
protected static java.security.MessageDigest md5Digest
           
protected static Object md5Lock
           
 
Constructor Summary
MD5DigestUtils()
           
 
Method Summary
static String generateAuth(String method, String uri, String username, String password, String realm, String nonce)
          Generate an HTTP authorization response
static String generateAuth(String a2Hash, String a1Hash, String realm, String nonce, String qop, String nonceCount, String cnonce)
          Generate an HTTP authorization response
static String generateAuth(String method, String uri, String a1Hash, String realm, String nonce, String qop, String nonceCount, String cnonce)
          Generate an HTTP authorization response
static String generateAuth(String method, String uri, String username, String password, String realm, String nonce, String qop, String nonceCount, String cnonce)
          Generate an HTTP authorization response
static String generateAuthHTTP(String method, String uri, String username, String password, String realm, String nonce, String qop, String nonceCount, String cnonce)
          Generate an HTTP authorization response
static String generateHash(String value)
          Generate MD5 hash
static byte[] generateHashBytes(byte[] value)
          Generate MD5 hash
static byte[] generateHashBytes(String value)
          Generate MD5 hash
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

md5Digest

protected static java.security.MessageDigest md5Digest

md5Lock

protected static Object md5Lock
Constructor Detail

MD5DigestUtils

public MD5DigestUtils()
Method Detail

generateAuth

public static String generateAuth(String method,
                                  String uri,
                                  String username,
                                  String password,
                                  String realm,
                                  String nonce)
Generate an HTTP authorization response

Parameters:
method - method
uri - URI
username - username
password - password
realm - realm
nonce - nonce
Returns:
auth response

generateAuth

public static String generateAuth(String a2Hash,
                                  String a1Hash,
                                  String realm,
                                  String nonce,
                                  String qop,
                                  String nonceCount,
                                  String cnonce)
Generate an HTTP authorization response

Parameters:
a2Hash - a2Hash
a1Hash - a1Hash
realm - realm
nonce - nonce
qop - qop
nonceCount - nonceCount
cnonce - cnonce
Returns:
auth

generateAuth

public static String generateAuth(String method,
                                  String uri,
                                  String a1Hash,
                                  String realm,
                                  String nonce,
                                  String qop,
                                  String nonceCount,
                                  String cnonce)
Generate an HTTP authorization response

Parameters:
method - method
uri - URI
a1Hash - a1Hash
realm - realm
nonce - nonce
qop - qop
nonceCount - nonceCount
cnonce - cnonce
Returns:
auth

generateAuth

public static String generateAuth(String method,
                                  String uri,
                                  String username,
                                  String password,
                                  String realm,
                                  String nonce,
                                  String qop,
                                  String nonceCount,
                                  String cnonce)
Generate an HTTP authorization response

Parameters:
method - method
uri - URI
username - username
password - password
realm - realm
nonce - nonce
qop - qop
nonceCount - nonceCount
cnonce - cnonce
Returns:
auth response

generateAuthHTTP

public static String generateAuthHTTP(String method,
                                      String uri,
                                      String username,
                                      String password,
                                      String realm,
                                      String nonce,
                                      String qop,
                                      String nonceCount,
                                      String cnonce)
Generate an HTTP authorization response

Parameters:
method - method
uri - URI
username - username
password - password
realm - realm
nonce - nonce
qop - qop
nonceCount - nonceCount
cnonce - cnonce
Returns:
response

generateHash

public static String generateHash(String value)
Generate MD5 hash

Parameters:
value - in string converted to byte array (UTF-8)
Returns:
hash as binhex string

generateHashBytes

public static byte[] generateHashBytes(byte[] value)
Generate MD5 hash

Parameters:
value - byte array to hash
Returns:
byte array result

generateHashBytes

public static byte[] generateHashBytes(String value)
Generate MD5 hash

Parameters:
value - in string converted to byte array (UTF-8)
Returns:
byte array result