Class BufferedBlockCipherBean

All Implemented Interfaces:
CipherBean

public class BufferedBlockCipherBean extends AbstractBlockCipherBean
Cipher bean that performs symmetric encryption/decryption using a standard block cipher in a standard mode (e.g. CBC, OFB) with padding to support processing inputs of arbitrary length.
Author:
Middleware Services
  • Constructor Details

    • BufferedBlockCipherBean

      public BufferedBlockCipherBean()
      Creates a new instance.
    • BufferedBlockCipherBean

      public BufferedBlockCipherBean(Spec<org.bouncycastle.crypto.BufferedBlockCipher> blockCipherSpec, KeyStore keyStore, String keyAlias, String keyPassword, Nonce nonce)
      Creates a new instance by specifying all properties.
      Parameters:
      blockCipherSpec - Block cipher specification.
      keyStore - Key store containing encryption key.
      keyAlias - Name of encryption key entry in key store.
      keyPassword - Password used to decrypt key entry in keystore.
      nonce - Nonce/IV generator.
  • Method Details

    • getBlockCipherSpec

      public Spec<org.bouncycastle.crypto.BufferedBlockCipher> getBlockCipherSpec()
      Returns:
      Block cipher specification.
    • setBlockCipherSpec

      public void setBlockCipherSpec(Spec<org.bouncycastle.crypto.BufferedBlockCipher> blockCipherSpec)
      Sets the block cipher specification.
      Parameters:
      blockCipherSpec - Describes a block cipher in terms of algorithm, mode, and padding.
    • newCipher

      protected BufferedBlockCipherAdapter newCipher(CiphertextHeader header, boolean mode)
      Description copied from class: AbstractBlockCipherBean
      Creates a new cipher adapter instance suitable for the block cipher used by this class.
      Specified by:
      newCipher in class AbstractBlockCipherBean
      Parameters:
      header - Ciphertext header.
      mode - True for encryption; false for decryption.
      Returns:
      Block cipher adapter that wraps an initialized block cipher that is ready for use in the given mode.