Package com.bitbucket.thinbus.srp6.js
Class HexHashedRoutines
- java.lang.Object
-
- com.bitbucket.thinbus.srp6.js.HexHashedRoutines
-
public class HexHashedRoutines extends Object
Secure Remote Password (SRP-6a) hashing routine for Java compatible with browser implementations by using hashing of string concatenated hex strings.Specification RFC 2945
- Author:
- Simon Massey
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringhashCredentials(MessageDigest digest, String salt, String identity, String password)static BigIntegerhashValues(MessageDigest digest, String... values)static StringleadingZerosPad(String value, int desiredLength)static StringtoHexString(byte[] bytes)http://stackoverflow.com/a/9855338 Compute a String in HexDigit from the input.
-
-
-
Method Detail
-
hashValues
public static BigInteger hashValues(MessageDigest digest, String... values)
-
leadingZerosPad
public static String leadingZerosPad(String value, int desiredLength)
-
hashCredentials
public static String hashCredentials(MessageDigest digest, String salt, String identity, String password)
-
toHexString
public static String toHexString(byte[] bytes)
http://stackoverflow.com/a/9855338 Compute a String in HexDigit from the input. Note that this string may have leading zeros but hex strings created by toString(16) of BigInteger would strip leading zeros.- Parameters:
bytes- Raw byte array- Returns:
- Hex encoding of the input
-
-