In our Spring Boot application, we pass an encrypted secret to the application as below In application.properties
secret=ENC(encryptedValue)
and in my application code i read it as
@Value("${secret}")
private String secret
this setup works perfectly fine.
Now we want to read multiple encrypted values from the same property as something like
@Value("${secret}")
private String[] secrets
What is the correct way to pass the encrypted values in .proprties file? we tried a few combinations like
secret = ENC(encryptedValue1), ENC(encryptedValue2)
or
secret = ENC(encryptedValue1,encryptedValue2)
but none of them work.!!
Is it possible to achieve this out of the box, if yes how should the properties be defined? if no, what is the custom logic that's needed?