Spring Cloud Tutorial (12) encryption and decryption

Source: Internet
Author: User

Spring Cloud has a pre-processor that decrypts property values locally Environment . It follows the same rules as the Config server, and by encrypt.* having the same external configuration. Therefore, you can use {cipher}* encrypted values in a format that, as long as there is a valid key, will be decrypted before the main application context gets fetched Environment . To use the encryption feature in your application, you need to include Spring security RSA (MAVEN coordinated "Org.springframework.security:spring-security-rsa") in your classpath. And you need a comprehensive, powerful JCE to extend your JVM.

If an exception is caused by an "illegal key size" and you are using Sun's JDK, you will need to install the Java Encryption Extensions (JCE) infinite Strength management policy file. For more information, see the following links:

    • Java 6 JCE

    • Java 7 JCE

    • Java 8 JCE

Unzip the file to the Jdk/jre/lib/security folder (regardless of which version of JRE/JDK x64/x86 you are using).

Endpoint

For spring boot executor applications, there are additional administrative endpoints:

    • Post to /env to update Environment and rebind @ConfigurationProperties and log levels

    • /refreshReload the boot band context and refresh the @RefreshScope bean

    • /restartShutdown ApplicationContext and restart (disabled by default)

    • /pauseand /resume calling Lifecycle methods ( stop() and start() ApplicationContext )

Source Source

Spring Cloud Tutorial (12) encryption and decryption

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.