- java.lang.Object
-
- com.appslandia.common.base.InitializeObject
-
- com.appslandia.common.crypto.SecretKeyGenerator
-
- All Implemented Interfaces:
InitializeSupport
public class SecretKeyGenerator extends InitializeObject
- Author:
- Loc Ha
-
-
Field Summary
Fields Modifier and Type Field Description static SecretKeyGeneratorPBKDF2_HMACSHA256static SecretKeyGeneratorPBKDF2_HMACSHA512
-
Constructor Summary
Constructors Constructor Description SecretKeyGenerator()SecretKeyGenerator(String algorithm)SecretKeyGenerator(String algorithm, String provider)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SecretKeyGeneratorcopy()byte[]generate(char[] password, byte[] salt, int iterationCount, int keySize)static byte[]generate(int keySize)protected voidinit()SecretKeyGeneratorsetAlgorithm(String algorithm)SecretKeyGeneratorsetProvider(String provider)-
Methods inherited from class com.appslandia.common.base.InitializeObject
assertNotInitialized, destroy, initialize
-
-
-
-
Field Detail
-
PBKDF2_HMACSHA256
public static final SecretKeyGenerator PBKDF2_HMACSHA256
-
PBKDF2_HMACSHA512
public static final SecretKeyGenerator PBKDF2_HMACSHA512
-
-
Method Detail
-
init
protected void init() throws Exception- Specified by:
initin classInitializeObject- Throws:
Exception
-
generate
public byte[] generate(char[] password, byte[] salt, int iterationCount, int keySize) throws CryptoException- Throws:
CryptoException
-
setAlgorithm
public SecretKeyGenerator setAlgorithm(String algorithm)
-
setProvider
public SecretKeyGenerator setProvider(String provider)
-
copy
public SecretKeyGenerator copy()
-
generate
public static byte[] generate(int keySize)
-
-