Spring Cloud Config - 加密密码 [英] Spring Cloud Config - Encrypt Password
问题描述
我看到spring cloud config提供了 / encrypt
和 / decrypt
端点。如何通过Advanced REST Client使用加密和解密端点来查看加密或解密的字符串?
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 < a href =http://cloud.spring.io/spring-cloud-static/spring-cloud.html#_encryption_and_decryption =nofollow> Spring Cloud Config文档声明:
服务器还公开
/ encrypt
和/ decrypt
端点(在
假设这些将被保护并且仅由授权的
代理访问)。如果您正在编辑远程配置文件,则可以使用
配置服务器通过 POSTing 将值加密到/ encrypt
端点。
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.
对于加密,请向<$发送 POST
请求c $ c> / encrypt 以明文作为请求正文的端点:
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
反向操作也可通过
/ decrypt
获得(前提是
服务器配置了对称密钥或完整密钥对)。
The inverse operation is also available via
/decrypt
(provided the server is configured with a symmetric key or a full key pair).
对于解密,请将 POST
请求发送到 /使用 Cipher Text 作为请求正文解密
端点:
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
这篇关于Spring Cloud Config - 加密密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!