public class PbeParameters extends AbstractBlockCipherParameters<PbeParameters>
| Modifier and Type | Field and Description |
|---|---|
static String |
ALGORITHM_PBE_MD5_DES
Algorithm for PBEWithMD5AndDES encryption.
|
static String |
ALGORITHM_PBE_SHA1_DES_EDE
Algorithm for PBEWithHmacSHA1AndDESede encryption.
|
static int |
DEFAULT_ITERATION_COUNT
Default number of PBE iterations.
|
static int |
DEFAULT_PASSWORD_SIZE
Default size of randomly generated passwords in bytes.
|
static int |
DEFAULT_SALT_SIZE
Default size of salt array in bytes.
|
BLOCK_MODE_CBC, BLOCK_MODE_CCM, BLOCK_MODE_CFB, BLOCK_MODE_CTR, BLOCK_MODE_CTS, BLOCK_MODE_ECB, BLOCK_MODE_GCM, BLOCK_MODE_OFB, BLOCK_MODE_PCBC, DEFAULT_BLOCK_SIZE, DEFAULT_PARAM_SPEC_SIZE_GCM, GCM_AUTH_TAG_LEN_104, GCM_AUTH_TAG_LEN_112, GCM_AUTH_TAG_LEN_120, GCM_AUTH_TAG_LEN_128, GCM_AUTH_TAG_LEN_96, PADDING_NONE, PADDING_PKCS5, PADDING_PKCS7KEY_SIZE_128, KEY_SIZE_192, KEY_SIZE_256, MAC_ALGORITHM_HMAC_MD5, MAC_ALGORITHM_HMAC_SHA1, MAC_ALGORITHM_HMAC_SHA224, MAC_ALGORITHM_HMAC_SHA256, MAC_ALGORITHM_HMAC_SHA3_224, MAC_ALGORITHM_HMAC_SHA3_256, MAC_ALGORITHM_HMAC_SHA3_384, MAC_ALGORITHM_HMAC_SHA3_512, MAC_ALGORITHM_HMAC_SHA384, MAC_ALGORITHM_HMAC_SHA512, MAC_ALGORITHM_HMAC_SHA512_224, MAC_ALGORITHM_HMAC_SHA512_256, MAC_KEY_SIZE_128, MAC_KEY_SIZE_160| Constructor and Description |
|---|
PbeParameters()
Initializes the PbeParameters.
|
PbeParameters(TextEncoder textEncoder)
Initializes the PbeParameters with a
TextEncoder which is used to decode the key when
set as a string. |
| Modifier and Type | Method and Description |
|---|---|
AlgorithmParameterSpec |
createParameterSpec(byte[] parameterData)
Generates an algorithm-specific
AlgorithmParameterSpec object used to hold algorithm
parameters such as an initialization vector or salt. |
protected byte[] |
generateKeyData(String algorithm)
Returns a randomly generated byte array used to create a key.
|
protected String |
getDefaultAlgorithm()
Returns the defaultAlgorithm.
|
int |
getIterationCount()
Returns the iterationCount value.
|
AlgorithmParameterSpec |
getParameterSpec(byte[] messageData)
Returns an algorithm-specific
AlgorithmParameterSpec object used to hold algorithm
parameters such as an initialization vector or salt from the enciphered message. |
int |
getParameterSpecSize()
Returns the algorithm parameter data size.
|
int |
getSaltSize()
Returns the saltSize value.
|
String |
getTransformation()
Returns the transformation value.
|
PbeParameters |
setAlgorithm(String algorithm)
Sets the algorithm value.
|
PbeParameters |
setIterationCount(int iterationCount)
Sets the iterationCount value.
|
PbeParameters |
setSaltSize(int saltSize)
Sets the saltSize value.
|
getBlockMode, getBlockSize, getDefaultBlockSize, getGcmTagLen, getPadding, setBlockMode, setBlockSize, setGcmTagLen, setPaddinggetDecryptionKey, getKey, loadKey, setKey, setKey, setKey, setKeyLoadergenerateParameterSpecData, getAlgorithm, getDefaultKeySize, getEncryptionKey, getKeySize, getMacAlgorithm, getMacKey, getMacKeySize, getProvider, getProviderName, hasDecryptionKey, hasEncryptionKey, parseAndVerifySalt, setDecryptionKey, setDecryptionKey, setDecryptionKey, setDecryptionKeyLoader, setEncryptionKey, setEncryptionKey, setEncryptionKey, setEncryptionKeyLoader, setKeySize, setMacAlgorithm, setMacKey, setMacKey, setMacKey, setMacKeyLoader, setMacKeySize, setProvider, setProviderName, setSaltGenerator, setSaltMatcherclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgenerateParameterSpecData, getAlgorithm, getEncryptionKey, getKeySize, getMacAlgorithm, getMacKey, getMacKeySize, getProvider, getProviderName, setKeySize, setMacAlgorithm, setMacKey, setMacKey, setMacKey, setMacKeyLoader, setMacKeySize, setProvider, setProviderName, setSaltGenerator, setSaltMatcherpublic static final String ALGORITHM_PBE_MD5_DES
public static final String ALGORITHM_PBE_SHA1_DES_EDE
public static final int DEFAULT_SALT_SIZE
public static final int DEFAULT_ITERATION_COUNT
public static final int DEFAULT_PASSWORD_SIZE
public PbeParameters()
public PbeParameters(TextEncoder textEncoder)
TextEncoder which is used to decode the key when
set as a string. The default transformation is 'PBEWithMD5AndDES'.textEncoder - the TextEncoderpublic PbeParameters setAlgorithm(String algorithm)
setAlgorithm in class AbstractAlgorithmParameters<PbeParameters>algorithm - The algorithm to set.protected String getDefaultAlgorithm()
getDefaultAlgorithm in class AbstractAlgorithmParameters<PbeParameters>public String getTransformation()
getTransformation in interface AlgorithmParameters<PbeParameters>getTransformation in class AbstractBlockCipherParameters<PbeParameters>public int getParameterSpecSize()
getParameterSpecSize in interface AlgorithmParameters<PbeParameters>getParameterSpecSize in class AbstractBlockCipherParameters<PbeParameters>public AlgorithmParameterSpec getParameterSpec(byte[] messageData) throws GeneralSecurityException
AlgorithmParameterSpec object used to hold algorithm
parameters such as an initialization vector or salt from the enciphered message.getParameterSpec in interface AlgorithmParameters<PbeParameters>getParameterSpec in class AbstractBlockCipherParameters<PbeParameters>messageData - the message data byte array which holds the parameter dataAlgorithmParameterSpec objectGeneralSecurityException - GeneralSecurityExceptionpublic AlgorithmParameterSpec createParameterSpec(byte[] parameterData)
AlgorithmParameterSpec object used to hold algorithm
parameters such as an initialization vector or salt.createParameterSpec in interface AlgorithmParameters<PbeParameters>createParameterSpec in class AbstractBlockCipherParameters<PbeParameters>parameterData - the data for the AlgorithmParameterSpecAlgorithmParameterSpec objectprotected byte[] generateKeyData(String algorithm) throws GeneralSecurityException
generateKeyData in class AbstractSymmetricAlgorithmParameters<PbeParameters>algorithm - the algorithm for the keyGeneralSecurityException - GeneralSecurityExceptionpublic int getSaltSize()
public PbeParameters setSaltSize(int saltSize)
saltSize - The saltSize to set.public int getIterationCount()
public PbeParameters setIterationCount(int iterationCount)
iterationCount - The iterationCount to set.