Class BinaryDbValueEncryptor
- java.lang.Object
-
- de.xima.fc.persistence.impl.security.BinaryDbValueEncryptor
-
- All Implemented Interfaces:
DbValueEncryptor<byte[],byte[]>
public class BinaryDbValueEncryptor extends Object implements DbValueEncryptor<byte[],byte[]>
Encryptor that encrypts and decrypts byte array values.- Since:
- 8.5.0
- Author:
- Norman Lorenz
-
-
Constructor Summary
Constructors Constructor Description BinaryDbValueEncryptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]decrypt(byte[] value, Properties config)Decrypts the given value.byte[]encrypt(byte[] value, Properties config)Encrypts the given value.Class<byte[]>getEncryptedType()Gets the class type of the encrypted value.Class<byte[]>getUnencryptedType()Gets the class type of the unencrypted value.
-
-
-
Method Detail
-
decrypt
public byte[] decrypt(byte[] value, Properties config) throws FcEncryptionExceptionDescription copied from interface:DbValueEncryptorDecrypts the given value.- Specified by:
decryptin interfaceDbValueEncryptor<byte[],byte[]>- 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
public byte[] encrypt(byte[] value, Properties config) throws FcEncryptionExceptionDescription copied from interface:DbValueEncryptorEncrypts the given value.- Specified by:
encryptin interfaceDbValueEncryptor<byte[],byte[]>- 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
public Class<byte[]> getEncryptedType()
Description copied from interface:DbValueEncryptorGets the class type of the encrypted value.- Specified by:
getEncryptedTypein interfaceDbValueEncryptor<byte[],byte[]>- Returns:
- The class type of the encrypted value.
-
getUnencryptedType
public Class<byte[]> getUnencryptedType()
Description copied from interface:DbValueEncryptorGets the class type of the unencrypted value.- Specified by:
getUnencryptedTypein interfaceDbValueEncryptor<byte[],byte[]>- Returns:
- The class type of the unencrypted value.
-
-