简体   繁体   中英

Spring Cloud Config - Encrypt Password

I saw that spring cloud config provides an /encrypt and /decrypt endpoints. How can I use the encrypt and decrypt endpoint via Advanced REST Client in order to view the encrypted or decrypted string?

As Spring Cloud Config documentation states:

The server also exposes /encrypt and /decrypt endpoints (on the assumption that these will be secured and only accessed by authorized agents). If you are editing a remote config file you can use the Config Server to encrypt values by POSTing to the /encrypt endpoint.

For encryption, send a POST request to the /encrypt endpoint with the Clear Text as the request body:

$ curl localhost:8888/encrypt -d mysecret
682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bda

The inverse operation is also available via /decrypt (provided the server is configured with a symmetric key or a full key pair).

For decryption, send a POST request to the /decrypt endpoint with the Cipher Text as the request body:

$ curl localhost:8888/decrypt -d 682bc583f4641835fa2db00935529366...
mysecret

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM