public abstract static class OpenSSLCipher.EVP_CIPHER extends OpenSSLCipher
| Modifier and Type | Class and Description |
|---|---|
static class |
OpenSSLCipher.EVP_CIPHER.AES |
static class |
OpenSSLCipher.EVP_CIPHER.AES_128 |
static class |
OpenSSLCipher.EVP_CIPHER.AES_256 |
protected static class |
OpenSSLCipher.EVP_CIPHER.AES_BASE |
static class |
OpenSSLCipher.EVP_CIPHER.ARC4 |
static class |
OpenSSLCipher.EVP_CIPHER.DESEDE |
OpenSSLCipher.EVP_AEAD, OpenSSLCipher.EVP_CIPHER, OpenSSLCipher.Mode, OpenSSLCipher.Padding| Modifier and Type | Field and Description |
|---|---|
protected boolean |
calledUpdate
Whether the cipher has processed any data yet.
|
encodedKey, iv, mode| Constructor and Description |
|---|
EVP_CIPHER(OpenSSLCipher.Mode mode,
OpenSSLCipher.Padding padding) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
doFinalInternal(byte[] output,
int outputOffset,
int maximumLen)
API-specific implementation of the final block.
|
protected void |
engineInitInternal(byte[] encodedKey,
AlgorithmParameterSpec params,
SecureRandom random)
API-specific implementation of initializing the cipher.
|
protected abstract String |
getCipherName(int keySize,
OpenSSLCipher.Mode mode)
Returns the OpenSSL cipher name for the particular
keySize
and cipher mode. |
protected int |
getOutputSizeForFinal(int inputLen)
The size of output if
doFinal() is called with this
inputLen. |
protected int |
getOutputSizeForUpdate(int inputLen)
The size of output if
update() is called with this
inputLen. |
protected int |
updateInternal(byte[] input,
int inputOffset,
int inputLen,
byte[] output,
int outputOffset,
int maximumLen)
API-specific implementation of updating the cipher.
|
checkSupportedKeySize, checkSupportedMode, checkSupportedPadding, engineDoFinal, engineDoFinal, engineGetBlockSize, engineGetIV, engineGetOutputSize, engineGetParameters, engineInit, engineInit, engineInit, engineSetMode, engineSetPadding, engineUnwrap, engineUpdate, engineUpdate, engineWrap, getBaseCipherName, getCipherBlockSize, getPadding, isEncrypting, supportsVariableSizeIv, supportsVariableSizeKeyengineDoFinal, engineGetKeySize, engineUpdate, engineUpdateAAD, engineUpdateAADprotected boolean calledUpdate
public EVP_CIPHER(OpenSSLCipher.Mode mode, OpenSSLCipher.Padding padding)
protected void engineInitInternal(byte[] encodedKey,
AlgorithmParameterSpec params,
SecureRandom random)
throws InvalidKeyException,
InvalidAlgorithmParameterException
OpenSSLCipherOpenSSLCipher.isEncrypting() function will tell whether it should be
initialized for encryption or decryption. The encodedKey will be
the bytes of a supported key size.engineInitInternal in class OpenSSLCipherInvalidKeyExceptionInvalidAlgorithmParameterExceptionprotected int updateInternal(byte[] input,
int inputOffset,
int inputLen,
byte[] output,
int outputOffset,
int maximumLen)
throws ShortBufferException
OpenSSLCiphermaximumLen will be the maximum length of the output as returned
by OpenSSLCipher.getOutputSizeForUpdate(int). The return value must be the
number of bytes processed and placed into output. On error, an
exception must be thrown.updateInternal in class OpenSSLCipherShortBufferExceptionprotected int doFinalInternal(byte[] output,
int outputOffset,
int maximumLen)
throws IllegalBlockSizeException,
BadPaddingException,
ShortBufferException
OpenSSLCiphermaximumLen
will be the maximum length of the possible output as returned by
OpenSSLCipher.getOutputSizeForFinal(int). The return value must be the number
of bytes processed and placed into output. On error, an exception
must be thrown.doFinalInternal in class OpenSSLCipherIllegalBlockSizeExceptionBadPaddingExceptionShortBufferExceptionprotected int getOutputSizeForFinal(int inputLen)
OpenSSLCipherdoFinal() is called with this
inputLen. If padding is enabled and the size of the input puts it
right at the block size, it will add another block for the padding.getOutputSizeForFinal in class OpenSSLCipherprotected int getOutputSizeForUpdate(int inputLen)
OpenSSLCipherupdate() is called with this
inputLen. If padding is enabled and the size of the input puts it
right at the block size, it will add another block for the padding.getOutputSizeForUpdate in class OpenSSLCipherprotected abstract String getCipherName(int keySize, OpenSSLCipher.Mode mode)
keySize
and cipher mode.