Package net.croz.nrich.encrypt.service
Class DefaultDataEncryptService
java.lang.Object
net.croz.nrich.encrypt.service.DefaultDataEncryptService
- All Implemented Interfaces:
DataEncryptionService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
decryptData
(T data, List<String> pathToEncryptDecryptList, EncryptionContext encryptionContext) Returns data with decrypted values matching path list.<T> T
encryptData
(T data, List<String> pathToEncryptDecryptList, EncryptionContext encryptionContext) Returns data with encrypted values matching path list.protected <T> T
encryptDecryptData
(T data, List<String> pathToEncryptDecryptList, EncryptionContext encryptionContext, EncryptionOperation encryptionOperation) protected void
encryptDecryptNestedValue
(EncryptionContext encryptionContext, Object objectContainingFieldsToEncryptOrDecrypt, String propertyName, EncryptionOperation operation) protected String
encryptDecryptText
(EncryptionContext encryptionContext, String text, EncryptionOperation operation) protected void
encryptDecryptValue
(EncryptionContext encryptionContext, Object objectContainingFieldsToEncryptOrDecrypt, String propertyName, EncryptionOperation operation) protected Object
encryptDecryptValue
(EncryptionContext encryptionContext, Object value, EncryptionOperation operation) protected void
executeEncryptionOperation
(EncryptionContext encryptionContext, Object object, String targetPath, EncryptionOperation operation) protected Object
getPropertyValueByPath
(Object holder, String path) protected void
setPropertyValueByPath
(Object holder, String path, Object value)
-
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 interfaceDataEncryptionService
- 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 encryptedencryptionContext
- 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 interfaceDataEncryptionService
- 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 decryptedencryptionContext
- 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
-
setPropertyValueByPath
-
encryptDecryptText
protected String encryptDecryptText(EncryptionContext encryptionContext, String text, EncryptionOperation operation)
-