public class SecureHashUtil extends Object
Constructor and Description |
---|
SecureHashUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
hashToHexString(byte[] hash) |
static String |
nextSecureHash()
Returns a new secure hash using the SHA-256 hash function salted with the SHA1PRNG random number generator.
|
static String |
nextSecureHash(String algorithm)
Returns a new secure hash using the specified hash function salted with the SHA1PRNG random number generator.
|
static String |
nextSecureHash(String algorithm,
byte[]... additionalSeed)
Get a new secure hash.
|
public static String nextSecureHash()
public static String nextSecureHash(String algorithm)
algorithm
- The hash function to use (SHA-1, SHA-256, MD5).public static String nextSecureHash(String algorithm, byte[]... additionalSeed)
algorithm
- The hash function to use (SHA-1, SHA-256, MD5).additionalSeed
- A vararg of additional byte[] seeds to optionally add additional salts to the hash function.public static String hashToHexString(byte[] hash)
Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.