Interface DbValueEncryptor<Decrypted extends Serializable, Encrypted extends Serializable>

Type Parameters:
Decrypted - The type of the unencrypted value, must be Serializable.
Encrypted - The type of the encrypted value, must be Serializable.

public interface DbValueEncryptor<Decrypted extends Serializable, Encrypted extends Serializable>
Interface for encrypting and decrypting values of type TUnencrypted.
Since:
8.5.0
Author:
Norman Lorenz
  • Method Details

    • decrypt

      Decrypted decrypt(Encrypted value, String scope) throws FcEncryptionException
      Decrypts the given value.
      Parameters:
      value - The value to decrypt.
      scope - Optional. The scope for decryption, can be used to differentiate between different encryption contexts.
      Returns:
      The decrypted value.
      Throws:
      FcEncryptionException - If decryption fails.
    • encrypt

      Encrypted encrypt(Decrypted value, String scope) throws FcEncryptionException
      Encrypts the given value.
      Parameters:
      value - The value to encrypt.
      scope - Optional. The scope for encryption, can be used to differentiate between different encryption contexts.
      Returns:
      The encrypted value.
      Throws:
      FcEncryptionException - If encryption fails.
    • getEncryptedType

      Class<Encrypted> getEncryptedType()
      Gets the class type of the encrypted value.
      Returns:
      The class type of the encrypted value.
    • getUnencryptedType

      Class<Decrypted> getUnencryptedType()
      Gets the class type of the unencrypted value.
      Returns:
      The class type of the unencrypted value.