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> TdecryptData(T data, List<String> pathToEncryptDecryptList, EncryptionContext encryptionContext) Returns data with decrypted values matching path list.<T> TencryptData(T data, List<String> pathToEncryptDecryptList, EncryptionContext encryptionContext) Returns data with encrypted values matching path list.protected <T> TencryptDecryptData(T data, List<String> pathToEncryptDecryptList, EncryptionContext encryptionContext, EncryptionOperation encryptionOperation) protected voidencryptDecryptNestedValue(EncryptionContext encryptionContext, Object objectContainingFieldsToEncryptOrDecrypt, String propertyName, EncryptionOperation operation) protected StringencryptDecryptText(EncryptionContext encryptionContext, String text, EncryptionOperation operation) protected voidencryptDecryptValue(EncryptionContext encryptionContext, Object objectContainingFieldsToEncryptOrDecrypt, String propertyName, EncryptionOperation operation) protected ObjectencryptDecryptValue(EncryptionContext encryptionContext, Object value, EncryptionOperation operation) protected voidexecuteEncryptionOperation(EncryptionContext encryptionContext, Object object, String targetPath, EncryptionOperation operation) protected ObjectgetPropertyValueByPath(Object holder, String path) protected voidsetPropertyValueByPath(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:DataEncryptionServiceReturns data with encrypted values matching path list.- Specified by:
encryptDatain 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:DataEncryptionServiceReturns data with decrypted values matching path list.- Specified by:
decryptDatain 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)
-