Interface CipherBean

All Known Implementing Classes:
AbstractBlockCipherBean, AbstractCipherBean, AEADBlockCipherBean, BufferedBlockCipherBean

public interface CipherBean
Bean that performs encryption/decryption using a symmetric cipher.
Author:
Middleware Services
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    decrypt(byte[] input)
    Decrypts the input data using a block cipher.
    void
    Decrypts the data from the input stream onto the output stream using a symmetric cipher.
    byte[]
    encrypt(byte[] input)
    Encrypts the input data using a symmetric cipher.
    void
    Encrypts the data from the input stream onto the output stream using a symmetric cipher.
  • Method Details

    • encrypt

      byte[] encrypt(byte[] input) throws CryptoException
      Encrypts the input data using a symmetric cipher.
      Parameters:
      input - Plaintext data to encrypt.
      Returns:
      Ciphertext output.
      Throws:
      CryptoException - on underlying cipher data handling errors.
    • encrypt

      void encrypt(InputStream input, OutputStream output) throws CryptoException, StreamException
      Encrypts the data from the input stream onto the output stream using a symmetric cipher.

      The caller is responsible for providing and managing the streams (e.g. closing them when finished).

      Parameters:
      input - Input stream containing plaintext data to encrypt.
      output - Output stream containing ciphertext produced by cipher in encryption mode.
      Throws:
      CryptoException - on underlying cipher data handling errors.
      StreamException - on stream IO errors.
    • decrypt

      byte[] decrypt(byte[] input) throws CryptoException
      Decrypts the input data using a block cipher.
      Parameters:
      input - Ciphertext data to encrypt.
      Returns:
      Plaintext output.
      Throws:
      CryptoException - on underlying cipher data handling errors.
    • decrypt

      void decrypt(InputStream input, OutputStream output) throws CryptoException, StreamException
      Decrypts the data from the input stream onto the output stream using a symmetric cipher.

      The caller is responsible for providing and managing the streams (e.g. closing them when finished).

      Parameters:
      input - Input stream containing ciphertext data to decrypt.
      output - Output stream containing plaintext produced by cipher in decryption mode.
      Throws:
      CryptoException - on underlying cipher data handling errors.
      StreamException - on stream IO errors.