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 Details

    • BinaryDbValueEncryptor

      public BinaryDbValueEncryptor()
  • Method Details

    • decrypt

      public byte[] decrypt(byte[] value, String scope) throws FcEncryptionException
      Description copied from interface: DbValueEncryptor
      Decrypts the given value.
      Specified by:
      decrypt in interface DbValueEncryptor<byte[],byte[]>
      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

      public byte[] encrypt(byte[] value, String scope) throws FcEncryptionException
      Description copied from interface: DbValueEncryptor
      Encrypts the given value.
      Specified by:
      encrypt in interface DbValueEncryptor<byte[],byte[]>
      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

      public Class<byte[]> getEncryptedType()
      Description copied from interface: DbValueEncryptor
      Gets the class type of the encrypted value.
      Specified by:
      getEncryptedType in interface DbValueEncryptor<byte[],byte[]>
      Returns:
      The class type of the encrypted value.
    • getUnencryptedType

      public Class<byte[]> getUnencryptedType()
      Description copied from interface: DbValueEncryptor
      Gets the class type of the unencrypted value.
      Specified by:
      getUnencryptedType in interface DbValueEncryptor<byte[],byte[]>
      Returns:
      The class type of the unencrypted value.