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.
|
getAlgorithm, getAuthenticationTagSize, getCipherBlockSize, getCipherInstance, getIVSize, getKdfSize, getKeySize, getTransformation, init, initializeIVData, initializeKeyData, resize, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
checkSupported, update, updateAAD, updateWithAAD
protected 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 BaseCipher
Exception
protected Cipher getInitializedCipherInstance() throws Exception
Exception
public void updateAAD(byte[] data, int offset, int length) throws Exception
Cipher
updateAAD
in interface Cipher
updateAAD
in class BaseCipher
data
- 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
Cipher
update
in interface Cipher
update
in class BaseCipher
input
- The input/output bytesinputOffset
- The offset of the data in the data bufferinputLen
- The number of bytes to update - starting at the given offsetException
- If failed to executeCopyright © 2008–2024 The Apache Software Foundation. All rights reserved.