- java.lang.Object
-
- com.appslandia.common.base.InitializeObject
-
- com.appslandia.common.crypto.PbeObject
-
- All Implemented Interfaces:
InitializeSupport
- Direct Known Subclasses:
PbeDigester,PbeEncryptor
public abstract class PbeObject extends InitializeObject
- Author:
- Loc Ha
-
-
Field Summary
Fields Modifier and Type Field Description protected intiterationCountprotected intkeySizeprotected char[]passwordprotected intsaltSizeprotected SecretKeyGeneratorsecretKeyGenerator
-
Constructor Summary
Constructors Constructor Description PbeObject()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SecretKeybuildSecretKey(byte[] salt, String algorithm)voiddestroy()protected voidinit()PbeObjectsetIterationCount(int iterationCount)PbeObjectsetKeySize(int keySize)PbeObjectsetPassword(char[] password)PbeObjectsetPassword(String passwordOrEnv)PbeObjectsetSaltSize(int saltSize)PbeObjectsetSecretKeyGenerator(SecretKeyGenerator secretKeyGenerator)-
Methods inherited from class com.appslandia.common.base.InitializeObject
assertNotInitialized, initialize
-
-
-
-
Field Detail
-
saltSize
protected int saltSize
-
iterationCount
protected int iterationCount
-
keySize
protected int keySize
-
password
protected char[] password
-
secretKeyGenerator
protected SecretKeyGenerator secretKeyGenerator
-
-
Method Detail
-
init
protected void init() throws Exception- Specified by:
initin classInitializeObject- Throws:
Exception
-
destroy
public void destroy() throws DestroyException- Specified by:
destroyin interfaceInitializeSupport- Overrides:
destroyin classInitializeObject- Throws:
DestroyException
-
buildSecretKey
protected SecretKey buildSecretKey(byte[] salt, String algorithm) throws CryptoException
- Throws:
CryptoException
-
setSaltSize
public PbeObject setSaltSize(int saltSize)
-
setIterationCount
public PbeObject setIterationCount(int iterationCount)
-
setKeySize
public PbeObject setKeySize(int keySize)
-
setPassword
public PbeObject setPassword(char[] password)
-
setSecretKeyGenerator
public PbeObject setSecretKeyGenerator(SecretKeyGenerator secretKeyGenerator)
-
-