Package com.itextpdf.kernel.crypto
Class AESGCMCipher
java.lang.Object
com.itextpdf.kernel.crypto.AESGCMCipher
Creates an Advanced Encryption Standard-Galois/Counter Mode (AES-GCM) Cipher.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAESGCMCipher
(boolean forEncryption, byte[] key, byte[] iv) Creates a new instance ofAESGCMCipher
. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
doFinal()
Finishes a multiple-part encryption or decryption operation, depending on how this cipher was initialized and resets underlying cipher object to the state it was in when previously initialized via a call to init.byte[]
update
(byte[] b, int off, int len) Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.
-
Field Details
-
MAC_SIZE_BITS
public static final int MAC_SIZE_BITS- See Also:
-
-
Constructor Details
-
AESGCMCipher
public AESGCMCipher(boolean forEncryption, byte[] key, byte[] iv) Creates a new instance ofAESGCMCipher
.- Parameters:
-
forEncryption
- if true the cipher is initialised for encryption, if false for decryption -
key
- the key to be used in the cipher -
iv
- initialization vector to be used in cipher
-
-
Method Details
-
update
public byte[] update(byte[] b, int off, int len) Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.The first
len
bytes in theb
input buffer, starting atoff
offset inclusive, are processed, and the result is stored in a new buffer.- Parameters:
-
b
- the input buffer -
off
- the offset inb
where the input starts -
len
- the input length - Returns:
- the new buffer with the result
-
doFinal
public byte[] doFinal()Finishes a multiple-part encryption or decryption operation, depending on how this cipher was initialized and resets underlying cipher object to the state it was in when previously initialized via a call to init.- Returns:
- final bytes array
-