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()
Returns the parameters that where used to create this cipher instance.
|
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)
Continues a multi-part transformation (encryption or decryption) with
Authenticated Additional Data (AAD).
|
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)
CipherSpiCipher is initialized and before any data is passed to the
instance.
This is only usable with cipher modes that support Authenticated Encryption with Additional Data (AEAD) such as Galois/Counter Mode (GCM).
engineUpdateAAD in class CipherSpiinput - bytes of AAD to use with the cipherinputOffset - offset within bytes of additional data to add to cipherinputLen - length of bytes of additional data to add to cipherprotected AlgorithmParameters engineGetParameters()
CipherSpiThese may be a the same parameters that were used to create this cipher instance, or may be a combination of default and random parameters, depending on the underlying cipher implementation.
engineGetParameters in class OpenSSLCiphernull if this cipher instance does not have any parameters
at all.protected abstract long getEVP_AEAD(int keyLength)
throws InvalidKeyException
InvalidKeyException