Class DefaultPropertyDetector
- java.lang.Object
-
- com.ulisesbocchio.jasyptspringboot.detector.DefaultPropertyDetector
-
- All Implemented Interfaces:
EncryptablePropertyDetector
public class DefaultPropertyDetector extends Object implements EncryptablePropertyDetector
Default property detector that detects encrypted property values with the format "$prefix$encrypted_value$suffix" Default values are "ENC(" and ")" respectively.- Version:
- $Id: $Id
- Author:
- Ulises Bocchio
-
-
Constructor Summary
Constructors Constructor Description DefaultPropertyDetector()Constructor for DefaultPropertyDetector.DefaultPropertyDetector(String prefix, String suffix)Constructor for DefaultPropertyDetector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisEncrypted(String property)Returns whether a property is encrypted or not.StringunwrapEncryptedValue(String property)Returns the portion of the property that is actually the encrypted value without any extra metadata such as prefixes and suffixes.
-
-
-
Method Detail
-
isEncrypted
public boolean isEncrypted(String property)
Returns whether a property is encrypted or not. Usually based on prefixes and suffixes.- Specified by:
isEncryptedin interfaceEncryptablePropertyDetector- Parameters:
property- the property value to check whether is encrypted or not.- Returns:
- true if the property is encrypted.
-
unwrapEncryptedValue
public String unwrapEncryptedValue(String property)
Returns the portion of the property that is actually the encrypted value without any extra metadata such as prefixes and suffixes.- Specified by:
unwrapEncryptedValuein interfaceEncryptablePropertyDetector- Parameters:
property- the property value to extract the encrypted value.- Returns:
- the encrypted portion of the property value.
-
-