T - the concrete type of this object.public abstract class AbstractBlockCipherParameters<T extends AbstractBlockCipherParameters<T>> extends AbstractSymmetricAlgorithmParameters<T>
| Modifier and Type | Field and Description |
|---|---|
static String |
BLOCK_MODE_CBC
Cipher Block Chaining Block Mode, as defined in FIPS PUB 81.
|
static String |
BLOCK_MODE_CCM
Counter/CBC Mode, as defined in NIST Special Publication SP 800-38C.
|
static String |
BLOCK_MODE_CFB
Cipher Feedback Block Mode, as defined in FIPS PUB 81.
|
static String |
BLOCK_MODE_CTR
A simplification of OFB, Counter mode updates the input block as a counter.
|
static String |
BLOCK_MODE_CTS
Cipher Text Stealing, as described in Bruce Schneier's book Applied Cryptography-Second Edition, John Wiley and Sons, 1996.
|
static String |
BLOCK_MODE_ECB
Electronic Codebook Block Mode, as defined in: The National Institute of Standards and
Technology (NIST) Federal Information Processing Standard (FIPS) PUB 81, "DES Modes of
Operation," U.S.
|
static String |
BLOCK_MODE_GCM
Galois/Counter Mode, as defined in NIST Special Publication SP 800-38D.
|
static String |
BLOCK_MODE_OFB
Output Feedback Block Mode, as defined in FIPS PUB 81.
|
static String |
BLOCK_MODE_PCBC
Propagating Cipher Block Chaining Block Mode, as defined by Kerberos V4.
|
static int |
DEFAULT_BLOCK_SIZE
Default block cipher size in bytes.
|
static int |
DEFAULT_PARAM_SPEC_SIZE_GCM
Default IV (parameter specification) size in bytes for GCM block mode.
|
static int |
GCM_AUTH_TAG_LEN_104
104-bit Authentication Tag length for GCM block mode ciphers, as defined in NIST Special Publication SP 800-38D.
|
static int |
GCM_AUTH_TAG_LEN_112
112-bit Authentication Tag length for GCM block mode ciphers, as defined in NIST Special Publication SP 800-38D.
|
static int |
GCM_AUTH_TAG_LEN_120
120-bit Authentication Tag length for GCM block mode ciphers, as defined in NIST Special Publication SP 800-38D.
|
static int |
GCM_AUTH_TAG_LEN_128
128-bit Authentication Tag length for GCM block mode ciphers, as defined in NIST Special Publication SP 800-38D.
|
static int |
GCM_AUTH_TAG_LEN_96
96-bit Authentication Tag length for GCM block mode ciphers, as defined in NIST Special Publication SP 800-38D.
|
static String |
PADDING_NONE
No padding.
|
static String |
PADDING_PKCS5
The padding scheme described in: RSA Laboratories, "PKCS #5: Password-Based Encryption
Standard," version 1.5, November 1993.
|
static String |
PADDING_PKCS7
The padding scheme described in: RSA Laboratories, "PKCS #7: Cryptographic Message Syntax,"
Version 1.5, November 1993.
|
KEY_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| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBlockCipherParameters()
Initializes the AbstractBlockCipherParameters.
|
protected |
AbstractBlockCipherParameters(TextEncoder textEncoder)
Initializes the AbstractBlockCipherParameters 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. |
String |
getBlockMode()
Returns the blockMode value.
|
int |
getBlockSize()
Returns the blockSize value in bytes.
|
int |
getDefaultBlockSize()
Returns the defaultBlockSize in bytes.
|
int |
getGcmTagLen()
Returns the GCM block mode Authentication Tag length in bits.
|
String |
getPadding()
Returns the padding 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.
|
String |
getTransformation()
Returns the transformation value.
|
T |
setBlockMode(String blockMode)
Sets the blockMode value.
|
T |
setBlockSize(int blockSize)
Sets the blockSize value in bytes.
|
T |
setGcmTagLen(int gcmTagLen)
Sets the GCM block mode Authentication Tag length in bits.
|
T |
setPadding(String padding)
Sets the padding value.
|
generateKeyData, getDecryptionKey, getKey, loadKey, setKey, setKey, setKey, setKeyLoadergenerateParameterSpecData, getAlgorithm, getDefaultAlgorithm, getDefaultKeySize, getEncryptionKey, getKeySize, getMacAlgorithm, getMacKey, getMacKeySize, getProvider, getProviderName, hasDecryptionKey, hasEncryptionKey, parseAndVerifySalt, setAlgorithm, 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 int DEFAULT_BLOCK_SIZE
public static final int DEFAULT_PARAM_SPEC_SIZE_GCM
public static final String BLOCK_MODE_CBC
public static final String BLOCK_MODE_CCM
public static final String BLOCK_MODE_CFB
public static final String BLOCK_MODE_CTR
public static final String BLOCK_MODE_CTS
public static final String BLOCK_MODE_ECB
public static final String BLOCK_MODE_GCM
public static final String BLOCK_MODE_OFB
public static final String BLOCK_MODE_PCBC
public static final int GCM_AUTH_TAG_LEN_96
public static final int GCM_AUTH_TAG_LEN_104
public static final int GCM_AUTH_TAG_LEN_112
public static final int GCM_AUTH_TAG_LEN_120
public static final int GCM_AUTH_TAG_LEN_128
public static final String PADDING_NONE
public static final String PADDING_PKCS5
public static final String PADDING_PKCS7
protected AbstractBlockCipherParameters()
protected AbstractBlockCipherParameters(TextEncoder textEncoder)
TextEncoder which is used to
decode the key when set as a string.textEncoder - the TextEncoderpublic int getDefaultBlockSize()
public String getTransformation()
public String getBlockMode()
public T setBlockMode(String blockMode)
blockMode - The blockMode to set.public int getParameterSpecSize()
public AlgorithmParameterSpec createParameterSpec(byte[] parameterData)
AlgorithmParameterSpec object used to hold algorithm
parameters such as an initialization vector or salt.createParameterSpec in interface AlgorithmParameters<T extends AbstractBlockCipherParameters<T>>createParameterSpec in class AbstractAlgorithmParameters<T extends AbstractBlockCipherParameters<T>>parameterData - the data for the AlgorithmParameterSpecAlgorithmParameterSpec objectpublic AlgorithmParameterSpec getParameterSpec(byte[] messageData) throws GeneralSecurityException
AlgorithmParameterSpec object used to hold algorithm
parameters such as an initialization vector or salt from the enciphered message.messageData - the message data byte array which holds the parameter dataAlgorithmParameterSpec objectGeneralSecurityException - GeneralSecurityExceptionpublic int getBlockSize()
public T setBlockSize(int blockSize)
blockSize - The blockSize to set.public int getGcmTagLen()
public T setGcmTagLen(int gcmTagLen)
gcmTagLen - the gcmTagLen to setpublic String getPadding()