Class BaseGCMCipher

java.lang.Object
org.apache.sshd.common.cipher.BaseCipher
org.apache.sshd.common.cipher.BaseGCMCipher
All Implemented Interfaces:
AlgorithmNameProvider, Cipher, CipherInformation, KeySizeIndicator

public class BaseGCMCipher extends BaseCipher
  • Field Details

  • Constructor Details

    • BaseGCMCipher

      public BaseGCMCipher(int ivsize, int authSize, int kdfSize, String algorithm, int keySize, String transformation, int blkSize)
  • Method Details

    • createCipherInstance

      protected Cipher createCipherInstance(Cipher.Mode mode, byte[] key, byte[] iv) throws Exception
      Overrides:
      createCipherInstance in class BaseCipher
      Throws:
      Exception
    • getInitializedCipherInstance

      protected Cipher getInitializedCipherInstance() throws Exception
      Throws:
      Exception
    • updateAAD

      public void updateAAD(byte[] data, int offset, int length) throws Exception
      Description copied from interface: Cipher
      Adds the provided input data as additional authenticated data during encryption or decryption.
      Specified by:
      updateAAD in interface Cipher
      Overrides:
      updateAAD in class BaseCipher
      Parameters:
      data - The additional data to authenticate
      offset - The offset of the additional data in the buffer
      length - The number of bytes in the buffer to use for authentication
      Throws:
      Exception - If failed to execute
    • update

      public void update(byte[] input, int inputOffset, int inputLen) throws Exception
      Description copied from interface: Cipher
      Performs in-place encryption or decryption on the given data.
      Specified by:
      update in interface Cipher
      Overrides:
      update in class BaseCipher
      Parameters:
      input - The input/output bytes
      inputOffset - The offset of the data in the data buffer
      inputLen - The number of bytes to update - starting at the given offset
      Throws:
      Exception - If failed to execute