How can i put the encription_key and encription_type in the @ColumnTransformer Annotation ‘read’ or ‘write’ parameter from application.yaml
@ColumnTransformer(read = "convert_from(decrypt(decode(phone,'hex'), {encription key}, {encription method}),'utf8')", write = "encode(encrypt(convert_to(?,'utf8'),{encription key}, {encription method}),'hex')")
What i did is
- get the value from application.yaml and put it in
@Value("${codec.iv}")
private final static String key="";
- Use Database Custom function to return bytea::encription_key - it is works but not want to
- HardCoding
- I also see that using postgres.conf - not want.
What i want to do is
get the key and encription_method from external files(like application.yaml etc…)