public abstract class PolicyTypeEncrypter<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
TEMPLATE_PREFIX |
protected static String |
TEMPLATE_SUFFIX |
| Constructor and Description |
|---|
PolicyTypeEncrypter(com.mulesoft.mule.runtime.gw.internal.encryption.RuntimeEncrypter runtimeEncrypter,
boolean isSensitiveOnlyEnabled,
List<PolicyProperty> policyProperties) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
decrypt(String value)
Decrypts a single value.
|
protected abstract EncryptedValueResult |
decryptSingle(String key,
T value)
Decrypts the given value if it is encrypted.
|
protected String |
encrypt(String value)
Encrypts a single value.
|
EncryptedValueResult |
encrypt(String key,
T value)
Depending on configuration and value metadata, it encrypts or decrypts (if already encrypted) the given config data value
|
protected abstract EncryptedValueResult |
encryptSingle(String key,
T value)
Encrypts the given value
|
boolean |
supports(String key)
Whether this encrypter supports treating the given key
|
protected abstract boolean |
supports(String key,
Optional<PolicyProperty> property) |
protected static final String TEMPLATE_PREFIX
protected static final String TEMPLATE_SUFFIX
public PolicyTypeEncrypter(com.mulesoft.mule.runtime.gw.internal.encryption.RuntimeEncrypter runtimeEncrypter,
boolean isSensitiveOnlyEnabled,
List<PolicyProperty> policyProperties)
public boolean supports(String key)
key - the key of the config data value that needs to be treatedpublic EncryptedValueResult encrypt(String key, T value)
key - the key of the config data valuevalue - the actual value to encrypt or decryptEncryptedValueResult containing the result of the processprotected abstract EncryptedValueResult encryptSingle(String key, T value)
key - the key of the config data valuevalue - the actual value to encrypt or decryptEncryptedValueResult containing the result of the processprotected abstract EncryptedValueResult decryptSingle(String key, T value)
key - the key of the config data valuevalue - the actual value to encrypt or decryptEncryptedValueResult containing the result of the processprotected abstract boolean supports(String key, Optional<PolicyProperty> property)
protected String encrypt(String value)
value - The value that might be encrypted. It must be unescaped before encryption.protected String decrypt(String value)
value - The value that should be decrypted. This may be already encrypted or not. If it is not encrypted (the value is
not between ![value] the decrypting function will leave the value untouched. In case of it being encrypted, it will
try to decrypt it. In both cases, and same as before encryption, it should be unescaped to get the original value and
avoid invalid characters when filling the template.Copyright © 2014–2022 MuleSoft, Inc.. All rights reserved.