Package de.xima.fc.persistence.hibernate
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.
- All Known Implementing Classes:
BinaryDbValueEncryptor,IntegerDbValueEncryptor,StringDbValueEncryptor
public interface DbValueEncryptor<Decrypted extends Serializable,Encrypted extends Serializable>Interface for encrypting and decrypting values stored in the database.Note: This interface is intended for internal use within the persistence layer. It should not be used directly in plugins or other external code.
- Since:
- 8.5.0
- Author:
- Norman Lorenz
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Decrypteddecrypt(Encrypted value, Properties config)Decrypts the given value.Encryptedencrypt(Decrypted value, Properties config)Encrypts the given value.Class<Encrypted>getEncryptedType()Gets the class type of the encrypted value.Class<Decrypted>getUnencryptedType()Gets the class type of the unencrypted value.
-
-
-
Method Detail
-
decrypt
Decrypted decrypt(Encrypted value, Properties config) throws FcEncryptionException
Decrypts the given value.- Parameters:
value- The value to decrypt.config- Optional. The configuration for decryption, can be used e.g. to differentiate between different encryption contexts.- Returns:
- The decrypted value.
- Throws:
FcEncryptionException- If decryption fails.
-
encrypt
Encrypted encrypt(Decrypted value, Properties config) throws FcEncryptionException
Encrypts the given value.- Parameters:
value- The value to encrypt.config- Optional. The configuration for encryption, can be used to e.g. 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.
-
-