Class TextEncryptorUtils
java.lang.Object
org.springframework.cloud.bootstrap.encrypt.TextEncryptorUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTextEncryptor 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Constructor Details
-
TextEncryptorUtils
public TextEncryptorUtils()
-
-
Method Details
-
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
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.
-