JavaMailSender is being auto configured in my Spring Boot application. How can I use annotations to allow encrypted values in my properties file for the properties "spring.mail.username"and "spring.mail.password" using the Jasypt library? please help.
import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class SimpleMailController {
@Autowired
private JavaMailSender sender;
I was able to crack it.
compile('com.github.ulisesbocchio:jasypt-spring-boot-starter:2.0.0')
All the properties used in my application now support encrypted values by default.