Spring Cloud 1.4.2 Edgware.SR2配置解密不会发生在客户端

时间:2018-02-15 16:42:33

标签: spring spring-cloud public-key-encryption spring-cloud-config

我使用了this project from spring.io并通过使用以下属性文件添加了非对称加密和解密。

<code>
    application properties (server side) :
       server.port=8888
       spring.cloud.config.server.git.uri=https://{uname}:{password}@{giturl}
       encrypt.key-store.location=classpath:/server.jks
       encrypt.key-store.password=letmein
       encrypt.key-store.alias=mytestkey
       encrypt.key-store.secret=changeme
       spring.cloud.config.server.encrypt.enabled=false
       security.user.name=root
       security.user.password=s3cr3t
</code>
<code>
    bootstrap.properties (client side) :
       spring.application.name=config-client
       spring.cloud.config.uri=http://root:s3cr3t@localhost:8888
       encrypt.key-store.location=classpath:/server.jks
       encrypt.key-store.password=letmein
       encrypt.key-store.alias=mytestkey
       encrypt.key-store.secret=changeme
       server.port=8089    
</code>

我的git中的属性文件有

<code>
    message={cipher}{key:mytestkey}AQA5...    
</code>

不幸的是,我在Spring RestController类中获取了加密消息,该类位于Spring Boot应用程序中。

<code>
     @RefreshScope
       @RestController
       class MessageRestController {
          @Value("${message}")
          private String message;

          @RequestMapping("/message")
          String getMessage() {
              return this.message;
          }
       }    
</code>

我错过了解密的东西吗?

0 个答案:

没有答案