I have stored (and encoded) an email password. I have used PasswordEncoder (Spring security).
passwordEncoder.encode(password);
Now I need to decode it in order to use it in javax mail. (the password is used to connect to the email provider(yahoo, gmail, etc).
Is there a way to decode this password?
PasswordEncoder interface support only encoding and matching which is the best way to deal with password as others too have suggested. You can use StandardPBEStringEncryptor provided by Jasypt library as this library had transparent integration with Spring Security. Else you can roll out your own using Java Cryptography Extension's Password Based Encryption (PBE) however before trying what you want to achieve with regards to password encryption you must definitely read this.