Interface Encrypter<T>

Type Parameters:
T - the type of the object to encrypt/decrypt
All Known Implementing Classes:
StringEncrypter

public interface Encrypter<T>
Author:
Luca Frosini (ISTI - CNR)
  • Method Summary

    Modifier and Type
    Method
    Description
    Decrypts the object using the context key
    decrypt(T t, Key key)
    Decrypts the object using the provided key
    Encrypts the object using the context key
    encrypt(T t, Key key)
    Encrypts the object using the provided key
  • Method Details

    • encrypt

      T encrypt(T t) throws Exception
      Encrypts the object using the context key
      Parameters:
      t - the object to encrypt
      Returns:
      the encrypted object
      Throws:
      Exception - if encryption fails
    • encrypt

      T encrypt(T t, Key key) throws Exception
      Encrypts the object using the provided key
      Parameters:
      t - the object to encrypt
      key - the key to use for encryption
      Returns:
      the encrypted object
      Throws:
      Exception - if encryption fails
    • decrypt

      T decrypt(T t) throws Exception
      Decrypts the object using the context key
      Parameters:
      t - the object to decrypt
      Returns:
      the decrypted object
      Throws:
      Exception - if decryption fails
    • decrypt

      T decrypt(T t, Key key) throws Exception
      Decrypts the object using the provided key
      Parameters:
      t - the object to decrypt
      key - the key to use for decryption
      Returns:
      the decrypted object
      Throws:
      Exception - if decryption fails