Class TextEncryptorUtils
- java.lang.Object
-
- org.springframework.cloud.bootstrap.encrypt.TextEncryptorUtils
-
public abstract class TextEncryptorUtils extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTextEncryptorUtils.FailsafeTextEncryptorTextEncryptor that just fails, so that users don't get a false sense of security adding ciphers to config files and not getting them decrypted.
-
Constructor Summary
Constructors Constructor Description TextEncryptorUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.springframework.security.crypto.encrypt.TextEncryptorcreateTextEncryptor(KeyProperties keyProperties, RsaProperties rsaProperties)Utility to create aTextEncryptorvia properties.static booleanisLegacyBootstrap(org.springframework.core.env.Environment environment)Method to check if legacy bootstrap mode is enabled.static booleankeysConfigured(KeyProperties properties)Is a key configured.static voidpromote(org.springframework.boot.BootstrapContext bootstrapContext, org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)Promote theTextEncryptorto theApplicationContext.static voidregister(org.springframework.boot.BootstrapRegistry registry)Register all classes that need aTextEncryptorinTextEncryptorConfigBootstrapper.
-
-
-
Method Detail
-
register
public static void register(org.springframework.boot.BootstrapRegistry registry)
Register all classes that need aTextEncryptorinTextEncryptorConfigBootstrapper.- Parameters:
registry- the BootstrapRegistry.
-
promote
public static void promote(org.springframework.boot.BootstrapContext bootstrapContext, org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)Promote theTextEncryptorto theApplicationContext.- Parameters:
bootstrapContext- the Context.beanFactory- the bean factory.
-
createTextEncryptor
public static org.springframework.security.crypto.encrypt.TextEncryptor createTextEncryptor(KeyProperties keyProperties, RsaProperties rsaProperties)
Utility to create aTextEncryptorvia properties.- Parameters:
keyProperties- the Key properties.rsaProperties- RSA properties.- Returns:
- created
TextEncryptor.
-
keysConfigured
public static boolean keysConfigured(KeyProperties properties)
Is a key configured.- Parameters:
properties- the Key properties.- Returns:
- true if configured.
-
isLegacyBootstrap
public static boolean isLegacyBootstrap(org.springframework.core.env.Environment environment)
Method to check if legacy bootstrap mode is enabled. This is either if the boot legacy processing property is set or spring.cloud.bootstrap.enabled=true.- Parameters:
environment- where to check properties.- Returns:
- true if bootstrap enabled.
-
-