Class DefaultDataEncryptService

java.lang.Object
net.croz.nrich.encrypt.service.DefaultDataEncryptService
All Implemented Interfaces:
DataEncryptionService

public class DefaultDataEncryptService extends Object implements DataEncryptionService
  • Constructor Details

    • DefaultDataEncryptService

      public DefaultDataEncryptService()
  • Method Details

    • encryptData

      public <T> T encryptData(T data, List<String> pathToEncryptDecryptList, EncryptionContext encryptionContext)
      Description copied from interface: DataEncryptionService
      Returns data with encrypted values matching path list.
      Specified by:
      encryptData in interface DataEncryptionService
      Type Parameters:
      T - type of data
      Parameters:
      data - object holding values that will be encrypted (can be a collection)
      pathToEncryptDecryptList - list of paths on data object that will be encrypted
      encryptionContext - context in which encryption operation is performed
      Returns:
      data object with encrypted values
    • decryptData

      public <T> T decryptData(T data, List<String> pathToEncryptDecryptList, EncryptionContext encryptionContext)
      Description copied from interface: DataEncryptionService
      Returns data with decrypted values matching path list.
      Specified by:
      decryptData in interface DataEncryptionService
      Type Parameters:
      T - type of data
      Parameters:
      data - object holding values that will be decrypted (can be a collection)
      pathToEncryptDecryptList - list of paths on data object that will be decrypted
      encryptionContext - context in which encryption operation is performed
      Returns:
      data object with decrypted values
    • encryptDecryptData

      protected <T> T encryptDecryptData(T data, List<String> pathToEncryptDecryptList, EncryptionContext encryptionContext, EncryptionOperation encryptionOperation)
    • executeEncryptionOperation

      protected void executeEncryptionOperation(EncryptionContext encryptionContext, Object object, String targetPath, EncryptionOperation operation)
    • encryptDecryptNestedValue

      protected void encryptDecryptNestedValue(EncryptionContext encryptionContext, Object objectContainingFieldsToEncryptOrDecrypt, String propertyName, EncryptionOperation operation)
    • encryptDecryptValue

      protected void encryptDecryptValue(EncryptionContext encryptionContext, Object objectContainingFieldsToEncryptOrDecrypt, String propertyName, EncryptionOperation operation)
    • encryptDecryptValue

      protected Object encryptDecryptValue(EncryptionContext encryptionContext, Object value, EncryptionOperation operation)
    • getPropertyValueByPath

      protected Object getPropertyValueByPath(Object holder, String path)
    • setPropertyValueByPath

      protected void setPropertyValueByPath(Object holder, String path, Object value)
    • encryptDecryptText

      protected String encryptDecryptText(EncryptionContext encryptionContext, String text, EncryptionOperation operation)