Package org.postgresql.util
Class MD5Digest
- java.lang.Object
-
- org.postgresql.util.MD5Digest
-
public class MD5Digest extends java.lang.ObjectMD5-based utility function to obfuscate passwords before network transmission.
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]HEX_BYTES
-
Constructor Summary
Constructors Modifier Constructor Description privateMD5Digest()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidbytesToHex(byte[] bytes, byte[] hex, int offset)static byte[]encode(byte[] user, byte[] password, byte[] salt)Encodes user/password/salt information in the following way: MD5(MD5(password + user) + salt).
-
-
-
Method Detail
-
encode
public static byte[] encode(byte[] user, byte[] password, byte[] salt)Encodes user/password/salt information in the following way: MD5(MD5(password + user) + salt).- Parameters:
user- The connecting user.password- The connecting user's password.salt- A four-salt sent by the server.- Returns:
- A 35-byte array, comprising the string "md5" and an MD5 digest.
-
bytesToHex
private static void bytesToHex(byte[] bytes, byte[] hex, int offset)
-
-