|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.security.SHA256
public class SHA256
This class implements the cryptographic hash function SHA-256.
Constructor Summary | |
---|---|
SHA256()
|
Method Summary | |
---|---|
static byte[] |
getHash(byte[] data,
boolean nullData)
Calculate the hash code for the given data. |
static byte[] |
getHashWithSalt(byte[] data,
byte[] salt)
Calculate the hash code by using the given salt. |
static byte[] |
getHMAC(byte[] key,
byte[] message)
Calculate the hash-based message authentication code. |
static byte[] |
getKeyPasswordHash(java.lang.String userName,
char[] password)
Calculate the hash of a password by prepending the user name and a '@' character. |
static byte[] |
getPBKDF2(byte[] password,
byte[] salt,
int iterations,
int resultLen)
Calculate the hash using the password-based key derivation function 2. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SHA256()
Method Detail |
---|
public static byte[] getHashWithSalt(byte[] data, byte[] salt)
data
- the data to hashsalt
- the salt to use
public static byte[] getKeyPasswordHash(java.lang.String userName, char[] password)
userName
- the user namepassword
- the password
public static byte[] getHMAC(byte[] key, byte[] message)
key
- the keymessage
- the message
public static byte[] getPBKDF2(byte[] password, byte[] salt, int iterations, int resultLen)
password
- the passwordsalt
- the saltiterations
- the number of iterationsresultLen
- the number of bytes in the result
public static byte[] getHash(byte[] data, boolean nullData)
data
- the data to hashnullData
- if the data should be filled with zeros after calculating
the hash code
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |