public static byte [ ] getHashedPassword ( ClientAuthScheme scheme , String password ) { if ( password == null ) { return null ; } MessageDigest md = null ; try { md = MessageDigest . getInstance ( ClientAuthScheme . getDigestScheme ( scheme ) ) ; } catch ( NoSuchAlgorithmException e ) { e . printStackTrace ( ) ; System . exit ( - 1 ) ; } byte hashedPassword [ ] = null ; hashedPassword = md . digest ( password . getBytes ( Constants . UTF8ENCODING ) ) ; return hashedPassword ; }
Get a hashed password using SHA - 1 in a consistent way .