Class CipherResourceJsonEncryptor
- java.lang.Object
-
- org.springframework.cloud.config.server.encryption.CipherResourceJsonEncryptor
-
- All Implemented Interfaces:
ResourceEncryptor
@Component public class CipherResourceJsonEncryptor extends Object implements ResourceEncryptor
ResourceEncryptorimplementation that can decrypt property values prefixed with {cipher} marker in a JSON file.- Author:
- Sean Stiglitz
-
-
Field Summary
Fields Modifier and Type Field Description protected StringCIPHER_MARKER
-
Constructor Summary
Constructors Constructor Description CipherResourceJsonEncryptor(TextEncryptorLocator encryptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringdecrypt(String text, Environment environment)protected StringdecryptValue(String value, String name, String[] profiles)protected StringdecryptWithJacksonParser(String text, String name, String[] profiles, com.fasterxml.jackson.core.JsonFactory factory)List<String>getSupportedExtensions()
-
-
-
Field Detail
-
CIPHER_MARKER
protected final String CIPHER_MARKER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CipherResourceJsonEncryptor
public CipherResourceJsonEncryptor(TextEncryptorLocator encryptor)
-
-
Method Detail
-
getSupportedExtensions
public List<String> getSupportedExtensions()
- Specified by:
getSupportedExtensionsin interfaceResourceEncryptor
-
decrypt
public String decrypt(String text, Environment environment) throws IOException
- Specified by:
decryptin interfaceResourceEncryptor- Throws:
IOException
-
decryptWithJacksonParser
protected String decryptWithJacksonParser(String text, String name, String[] profiles, com.fasterxml.jackson.core.JsonFactory factory) throws IOException
- Throws:
IOException
-
-