gpt4 book ai didi

java - Spring Cloud Config - 加密密码

转载 作者:行者123 更新时间:2023-11-29 04:45:10 24 4
gpt4 key购买 nike

我看到 spring cloud config 提供了一个 /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.

对于加密,将 POST 请求发送到 /encrypt 端点,并将 Clear Text 作为请求正文:

$ 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).

对于解密,将POST 请求发送到/decrypt 端点,并将Cipher Text 作为请求正文:

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

关于java - Spring Cloud Config - 加密密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37488311/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com