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 class 
    TextEncryptor 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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.springframework.security.crypto.encrypt.TextEncryptor
    createTextEncryptor(KeyProperties keyProperties, RsaProperties rsaProperties)
    Utility to create a TextEncryptor via properties.
    static boolean
    isLegacyBootstrap(org.springframework.core.env.Environment environment)
    Method to check if legacy bootstrap mode is enabled.
    static boolean
    Is a key configured.
    static void
    promote(org.springframework.boot.BootstrapContext bootstrapContext, org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
    Promote the TextEncryptor to the ApplicationContext.
    static void
    register(org.springframework.boot.BootstrapRegistry registry)
    Register all classes that need a TextEncryptor in TextEncryptorConfigBootstrapper.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TextEncryptorUtils

      public TextEncryptorUtils()
  • Method Details

    • 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.