Spring Encrypt Values from Properties File

前端 未结 2 1807
野趣味
野趣味 2021-01-14 12:22

I am currently using a UserDetailsService to get values from a user file:



        
2条回答
  •  情话喂你
    2021-01-14 12:39

    Take a look at Jasypt, it is a java library which allows the developer to add basic encryption capabilities to his/her projects with minimum effort, and without the need of having deep knowledge on how cryptography works.

    You can see how to configure it with Spring here

    As an alternative, you may also implement your own propertyPersister to do the (d)encryption:

    
        
            classpath:com/foo/jdbc.properties
        
        
            
                
    
    

    Take a look at the example here

提交回复
热议问题