Class TextEncryptorUtils


  • public abstract class TextEncryptorUtils
    extends Object
    • Constructor Detail

      • TextEncryptorUtils

        public TextEncryptorUtils()
    • Method Detail

      • register

        public static void register​(org.springframework.boot.BootstrapRegistry registry)
        Register all classes that need a TextEncryptor in TextEncryptorConfigBootstrapper.
        Parameters:
        registry - the BootstrapRegistry.
      • promote

        public static void promote​(org.springframework.boot.BootstrapContext bootstrapContext,
                                   org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
        Promote the TextEncryptor to the ApplicationContext.
        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 a TextEncryptor via 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.