Package com.soffid.iam.crypt
Class Crypt
- java.lang.Object
-
- com.soffid.iam.crypt.Crypt
-
public class Crypt extends Object
-
-
Constructor Summary
Constructors Constructor Description Crypt()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
genSalt()
static String
genSalt(int size)
static byte[]
genSaltBytes()
static byte[]
genSaltBytes(int size)
static String
hash(String algorithm, String text)
static String
pBKDF2Sha1(String text, byte[] salt, int iterations)
static String
pBKDF2Sha1(String text, String utf8Salt, int iterations)
static String
pBKDF2Sha256(String text, byte[] salt, int iterations)
static String
pBKDF2Sha256(String text, String utf8Salt, int iterations)
static boolean
verify(String algorithm, String text, String hash)
-
-
-
Method Detail
-
pBKDF2Sha256
public static String pBKDF2Sha256(String text, String utf8Salt, int iterations) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
pBKDF2Sha256
public static String pBKDF2Sha256(String text, byte[] salt, int iterations) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
pBKDF2Sha1
public static String pBKDF2Sha1(String text, String utf8Salt, int iterations) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
pBKDF2Sha1
public static String pBKDF2Sha1(String text, byte[] salt, int iterations) throws UnsupportedEncodingException, InvalidKeySpecException, NoSuchAlgorithmException
-
genSaltBytes
public static byte[] genSaltBytes() throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
genSaltBytes
public static byte[] genSaltBytes(int size) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
genSalt
public static String genSalt() throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
genSalt
public static String genSalt(int size) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
-