Class AESGCMCipher

java.lang.Object
com.itextpdf.kernel.crypto.AESGCMCipher

public class AESGCMCipher extends Object
Creates an Advanced Encryption Standard-Galois/Counter Mode (AES-GCM) Cipher.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AESGCMCipher(boolean forEncryption, byte[] key, byte[] iv)
    Creates a new instance of AESGCMCipher.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • AESGCMCipher

      public AESGCMCipher (boolean forEncryption, byte[] key, byte[] iv)
      Creates a new instance of AESGCMCipher.
      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 the b input buffer, starting at off offset inclusive, are processed, and the result is stored in a new buffer.

      Parameters:
      b - the input buffer
      off - the offset in b 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