public class BaseGCMCipher extends BaseCipher
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BaseGCMCipher.CounterGCMParameterSpec
Algorithm parameters for AES/GCM that assumes the IV uses an 8-byte counter field as its least significant bytes.
|
Cipher.Mode| Modifier and Type | Field and Description |
|---|---|
protected boolean |
initialized |
protected Cipher.Mode |
mode |
protected BaseGCMCipher.CounterGCMParameterSpec |
parameters |
protected SecretKey |
secretKey |
| Constructor and Description |
|---|
BaseGCMCipher(int ivsize,
int authSize,
int kdfSize,
String algorithm,
int keySize,
String transformation,
int blkSize) |
| Modifier and Type | Method and Description |
|---|---|
protected Cipher |
createCipherInstance(Cipher.Mode mode,
byte[] key,
byte[] iv) |
protected Cipher |
getInitializedCipherInstance() |
void |
update(byte[] input,
int inputOffset,
int inputLen)
Performs in-place encryption or decryption on the given data.
|
void |
updateAAD(byte[] data,
int offset,
int length)
Adds the provided input data as additional authenticated data during encryption or decryption.
|
determineNewParameters, getAlgorithm, getAuthenticationTagSize, getCipherBlockSize, getCipherInstance, getIVSize, getKdfSize, getKeySize, getTransformation, init, initializeIVData, initializeKeyData, reInit, resize, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcheckSupported, update, updateAAD, updateWithAADprotected Cipher.Mode mode
protected boolean initialized
protected BaseGCMCipher.CounterGCMParameterSpec parameters
protected SecretKey secretKey
protected Cipher createCipherInstance(Cipher.Mode mode, byte[] key, byte[] iv) throws Exception
createCipherInstance in class BaseCipherExceptionprotected Cipher getInitializedCipherInstance() throws Exception
Exceptionpublic void updateAAD(byte[] data,
int offset,
int length)
throws Exception
CipherupdateAAD in interface CipherupdateAAD in class BaseCipherdata - The additional data to authenticateoffset - The offset of the additional data in the bufferlength - The number of bytes in the buffer to use for authenticationException - If failed to executepublic void update(byte[] input,
int inputOffset,
int inputLen)
throws Exception
Cipherupdate in interface Cipherupdate in class BaseCipherinput - The input/output bytesinputOffset - The offset of the data in the data bufferinputLen - The number of bytes to update, starting at the given offset; must be a multiple of the
cipher's block sizeException - If failed to executeCopyright © 2018–2024 The Apache Software Foundation. All rights reserved.