我看到 Spring Cloud 配置提供了 /encrypt
和 /decrypt
端点。如何通过高级 REST 客户端使用加密和解密端点来查看加密或解密的字符串?
最佳答案
如Spring Cloud Config documentation状态:
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.
要进行加密,请向 /encrypt
端点发送一个 POST
请求,并将明文作为请求正文:
$ 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).
要进行解密,请向 /decrypt
端点发送一个 POST
请求,并将密文作为请求正文:
$ curl localhost:8888/decrypt -d 682bc583f4641835fa2db00935529366...
mysecret
关于java - Spring Cloud Config - 加密密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37488311/