iText 9.8.0 API
iText.Commons.Bouncycastle.Crypto.Modes.IGCMBlockCipher Interface Reference

Interface for aes-gcm cryptographic ciphers. More...

Inheritance diagram for iText.Commons.Bouncycastle.Crypto.Modes.IGCMBlockCipher:
iText.Bouncycastle.Crypto.Modes.GCMBlockCipherBC iText.Bouncycastlefips.Crypto.Modes.GCMBlockCipherBCFips

Public Member Functions

void  Init (bool forEncryption, byte[] key, int macSizeBits, byte[] iv)
  Initialize this cipher with a key and a set of algorithm parameters. More...
 
int  GetUpdateOutputSize (int len)
  Returns the length in bytes that an output buffer would need to be in order to hold the result of the next update operation, given the input length (in bytes). More...
 
void  ProcessBytes (byte[] input, int inputOffset, int len, byte[] output, int outOffset)
  Perform a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. More...
 
byte[]  ProcessBytes (byte[] input, int inputOffset, int len)
  Perform a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. More...
 
int  GetOutputSize (int len)
  Returns the length in bytes that an output buffer would need to be in order to hold the result of the next doFinal operation, given the input length (in bytes). More...
 
void  DoFinal (byte[] plainText, int i)
  Finishes a multiple-part encryption or decryption operation, depending on how this cipher was initialized. More...
 
byte[]  DoFinal ()
  Finishes a multiple-part encryption or decryption operation, depending on how this cipher was initialized. More...
 

Detailed Description

Interface for aes-gcm cryptographic ciphers.

Member Function Documentation

◆ DoFinal() [1/2]

byte [] iText.Commons.Bouncycastle.Crypto.Modes.IGCMBlockCipher.DoFinal ( )

Finishes a multiple-part encryption or decryption operation, depending on how this cipher was initialized.

Finishes a multiple-part encryption or decryption operation, depending on how this cipher was initialized. Input data that may have been buffered during a previous update operation is processed, also the authentication tag is appended in the case of encryption, or verified in the case of decryption.

Returns
byte array with the result

Implemented in iText.Bouncycastle.Crypto.Modes.GCMBlockCipherBC, and iText.Bouncycastlefips.Crypto.Modes.GCMBlockCipherBCFips.

◆ DoFinal() [2/2]

void iText.Commons.Bouncycastle.Crypto.Modes.IGCMBlockCipher.DoFinal ( byte[]  plainText,
int  i 
)

Finishes a multiple-part encryption or decryption operation, depending on how this cipher was initialized.

Finishes a multiple-part encryption or decryption operation, depending on how this cipher was initialized. Input data that may have been buffered during a previous update operation is processed, also the authentication tag is appended in the case of encryption, or verified in the case of decryption.

Parameters
plainText the buffer for the result
i the offset in output where the result is stored

Implemented in iText.Bouncycastlefips.Crypto.Modes.GCMBlockCipherBCFips, and iText.Bouncycastle.Crypto.Modes.GCMBlockCipherBC.

◆ GetOutputSize()

int iText.Commons.Bouncycastle.Crypto.Modes.IGCMBlockCipher.GetOutputSize ( int  len )

Returns the length in bytes that an output buffer would need to be in order to hold the result of the next doFinal operation, given the input length (in bytes).

Parameters
len input length (in bytes)
Returns
output length in bytes

Implemented in iText.Bouncycastle.Crypto.Modes.GCMBlockCipherBC, and iText.Bouncycastlefips.Crypto.Modes.GCMBlockCipherBCFips.

◆ GetUpdateOutputSize()

int iText.Commons.Bouncycastle.Crypto.Modes.IGCMBlockCipher.GetUpdateOutputSize ( int  len )

Returns the length in bytes that an output buffer would need to be in order to hold the result of the next update operation, given the input length (in bytes).

Parameters
len input length (in bytes)
Returns
output length in bytes

Implemented in iText.Bouncycastlefips.Crypto.Modes.GCMBlockCipherBCFips, and iText.Bouncycastle.Crypto.Modes.GCMBlockCipherBC.

◆ Init()

void iText.Commons.Bouncycastle.Crypto.Modes.IGCMBlockCipher.Init ( bool  forEncryption,
byte[]  key,
int  macSizeBits,
byte[]  iv 
)

Initialize this cipher with a key and a set of algorithm parameters.

Parameters
forEncryption true to use encrypt mode, false to use decrypt mode
key the encryption key
macSizeBits MAC size, MAC sizes from 32 bits to 128 bits (must be a multiple of 8)
iv the IV source buffer

Implemented in iText.Bouncycastle.Crypto.Modes.GCMBlockCipherBC, and iText.Bouncycastlefips.Crypto.Modes.GCMBlockCipherBCFips.

◆ ProcessBytes() [1/2]

byte [] iText.Commons.Bouncycastle.Crypto.Modes.IGCMBlockCipher.ProcessBytes ( byte[]  input,
int  inputOffset,
int  len 
)

Perform a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

Parameters
input the input buffer
inputOffset the offset in input where the input starts
len the input length
Returns
byte array with the result

Implemented in iText.Bouncycastlefips.Crypto.Modes.GCMBlockCipherBCFips, and iText.Bouncycastle.Crypto.Modes.GCMBlockCipherBC.

◆ ProcessBytes() [2/2]

void iText.Commons.Bouncycastle.Crypto.Modes.IGCMBlockCipher.ProcessBytes ( byte[]  input,
int  inputOffset,
int  len,
byte[]  output,
int  outOffset 
)

Perform a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

Parameters
input the input buffer
inputOffset the offset in input where the input starts
len the input length
output the buffer for the result
outOffset the offset in output where the result is stored

Implemented in iText.Bouncycastlefips.Crypto.Modes.GCMBlockCipherBCFips, and iText.Bouncycastle.Crypto.Modes.GCMBlockCipherBC.