| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static byte[] | Returns: the hash codethe data to hash data, boolean if the data should be filled with zeros after calculating
the hash code nullData)Calculate the hash code for the given data. |
| public static byte[] | Returns: the hash codethe data to hash data, byte[] the salt to use salt)Calculate the hash code by using the given salt. |
| public static byte[] | Returns: the hashthe key key, byte[] the message message)Calculate the hash-based message authentication code. |
| public static byte[] | Returns: the hash codethe user name userName, char[] the password password)Calculate the hash of a password by prepending the user name and a '@' character. |
| public static byte[] | Returns: the resultthe password password, byte[] the salt salt, int the number of iterations iterations, int the number of bytes in the result resultLen)Calculate the hash using the password-based key derivation function 2. |
| private static Mac |
| SHA256 | back to summary |
|---|---|
| private SHA256() | |
| getHash | back to summary |
|---|---|
| public static byte[] getHash(byte[] data, boolean nullData) Calculate the hash code for the given data.
| |
| getHashWithSalt | back to summary |
|---|---|
| public static byte[] getHashWithSalt(byte[] data, byte[] salt) Calculate the hash code by using the given salt. The salt is appended after the data before the hash code is calculated. After generating the hash code, the data and all internal buffers are filled with zeros to avoid keeping insecure data in memory longer than required (and possibly swapped to disk).
| |
| getHMAC | back to summary |
|---|---|
| public static byte[] getHMAC(byte[] key, byte[] message) Calculate the hash-based message authentication code.
| |
| getKeyPasswordHash | back to summary |
|---|---|
| public static byte[] getKeyPasswordHash(String userName, char[] password) Calculate the hash of a password by prepending the user name and a '@' character. Both the user name and the password are encoded to a byte array using UTF-16. After generating the hash code, the password array and all internal buffers are filled with zeros to avoid keeping the plain text password in memory longer than required (and possibly swapped to disk).
| |
| getPBKDF2 | back to summary |
|---|---|
| public static byte[] getPBKDF2(byte[] password, byte[] salt, int iterations, int resultLen) Calculate the hash using the password-based key derivation function 2.
| |
| initMac | back to summary |
|---|---|
| private static Mac initMac(byte[] key) | |