spring-bootjasypt

spring boot with jasypt jvm argument alternative


I know that spring boot works with jasypt, by supplying jvm argument -Djasypt.encryptor.password=password , the framework will use it to decrypt. However, in my use case, we cannot supply jvm argument, how do i do this programtically in code instead?


Solution

  • You can set the argument manullay in your code.

    System.setProperty("jasypt.encryptor.password", "password");
    

    You see more details here