Class AESEngineNoPadding

java.lang.Object
org.sejda.sambox.encryption.AESEngineNoPadding
All Implemented Interfaces:
AESEncryptionAlgorithmEngine, EncryptionAlgorithmEngine
Direct Known Subclasses:
ConcatenatingAESEngine

class AESEngineNoPadding extends Object implements AESEncryptionAlgorithmEngine
AES implementation of a EncryptionAlgorithmEngine with no pudding
  • Field Details

    • cipher

      private final org.bouncycastle.crypto.BufferedBlockCipher cipher
  • Constructor Details

    • AESEngineNoPadding

      AESEngineNoPadding(org.bouncycastle.crypto.BufferedBlockCipher cipher)
  • Method Details

    • encryptStream

      public InputStream encryptStream(InputStream data, byte[] key, byte[] iv)
      Specified by:
      encryptStream in interface AESEncryptionAlgorithmEngine
      Returns:
      a stream encrypted with the given key and initialization vector
    • encryptStream

      public InputStream encryptStream(InputStream data, byte[] key)
      Specified by:
      encryptStream in interface EncryptionAlgorithmEngine
      Parameters:
      data - data to encrypt
      Returns:
      a stream where encrypted data can be read from
    • encryptBytes

      public byte[] encryptBytes(byte[] data, byte[] key, byte[] iv)
      Specified by:
      encryptBytes in interface AESEncryptionAlgorithmEngine
      Returns:
      the byte array encrypted with the given key and initialization vector
    • encryptBytes

      public byte[] encryptBytes(byte[] data, byte[] key)
      Specified by:
      encryptBytes in interface EncryptionAlgorithmEngine
      Parameters:
      data - data to encrypt
      Returns:
      the encrypted data
    • init

      private void init(byte[] key, byte[] iv)
    • cbc

      static AESEngineNoPadding cbc()
      Returns:
      and instance of EncryptionAlgorithmEngine AES/CBC/NoPadding and no initialization vector
    • ecb

      static AESEngineNoPadding ecb()
      Returns:
      and instance of EncryptionAlgorithmEngine AES/ECB/NoPadding and no initialization vector