Interface CryptoService

All Known Implementing Classes:
AbstractCryptoService, BcCryptoServiceImpl, JcaCryptoServiceImpl

public interface CryptoService
Abstraction for stream based symmetric encryption and decryption services. Implementations return InputStream instances that must be consumed and closed by the caller. Concrete implementations include JcaCryptoServiceImpl and BcCryptoServiceImpl.
  • Method Details

    • encrypt

      InputStream encrypt(InputStream inputStream)
      Encrypts the provided data stream.
      Parameters:
      inputStream - plaintext data to encrypt
      Returns:
      a stream containing the encrypted data
    • decrypt

      InputStream decrypt(InputStream inputStream)
      Decrypts an encrypted data stream.
      Parameters:
      inputStream - the encrypted data
      Returns:
      a stream yielding the decrypted plaintext
    • encryptText

      String encryptText(String text)
      Encrypts a text value and returns the Base64 encoded result.
      Parameters:
      text - the text to encrypt
      Returns:
      encrypted text encoded in Base64
    • decryptText

      String decryptText(String encryptedText)
      Decrypts a Base64 encoded encrypted text value.
      Parameters:
      encryptedText - the Base64 encoded encrypted text
      Returns:
      the decrypted plain text