public abstract static class OpenSSLCipher.EVP_AEAD extends OpenSSLCipher
| Modifier and Type | Class and Description |
|---|---|
static class |
OpenSSLCipher.EVP_AEAD.AES |
OpenSSLCipher.EVP_AEAD, OpenSSLCipher.EVP_CIPHER, OpenSSLCipher.Mode, OpenSSLCipher.Padding| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
buf
The byte array containing the bytes written.
|
protected int |
bufCount
The number of bytes written.
|
protected long |
evpAead
AEAD cipher reference.
|
encodedKey, iv, mode| Constructor and Description |
|---|
EVP_AEAD(OpenSSLCipher.Mode mode) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkSupportedPadding(OpenSSLCipher.Padding padding)
Checks whether the cipher supports this particular cipher
padding
and throws NoSuchPaddingException if it doesn't. |
protected int |
doFinalInternal(byte[] output,
int outputOffset,
int maximumLen)
API-specific implementation of the final block.
|
protected AlgorithmParameters |
engineGetParameters() |
protected void |
engineInitInternal(byte[] encodedKey,
AlgorithmParameterSpec params,
SecureRandom random)
API-specific implementation of initializing the cipher.
|
protected void |
engineUpdateAAD(byte[] input,
int inputOffset,
int inputLen) |
protected abstract long |
getEVP_AEAD(int keyLength) |
protected int |
getOutputSizeForFinal(int inputLen)
The size of output if
doFinal() 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, engineDoFinal, engineDoFinal, engineGetBlockSize, engineGetIV, engineGetOutputSize, engineInit, engineInit, engineInit, engineSetMode, engineSetPadding, engineUnwrap, engineUpdate, engineUpdate, engineWrap, getBaseCipherName, getCipherBlockSize, getOutputSizeForUpdate, getPadding, isEncrypting, supportsVariableSizeIv, supportsVariableSizeKeyengineDoFinal, engineGetKeySize, engineUpdate, engineUpdateAADprotected byte[] buf
protected int bufCount
protected long evpAead
public EVP_AEAD(OpenSSLCipher.Mode mode)
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
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 OpenSSLCipherIllegalBlockSizeExceptionBadPaddingExceptionprotected void checkSupportedPadding(OpenSSLCipher.Padding padding) throws NoSuchPaddingException
OpenSSLCipherpadding
and throws NoSuchPaddingException if it doesn't.checkSupportedPadding in class OpenSSLCipherNoSuchPaddingExceptionprotected 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 void engineUpdateAAD(byte[] input,
int inputOffset,
int inputLen)
engineUpdateAAD in class CipherSpiprotected AlgorithmParameters engineGetParameters()
engineGetParameters in class OpenSSLCipherprotected abstract long getEVP_AEAD(int keyLength)
throws InvalidKeyException
InvalidKeyException