Reputation: 3829
I'd like to put an encrypted password in the configuration section. I have the decryption function, but where do I put it so that when SMTPClient is instantiated using this configuration information that I can run the decryption function for the password?
Thanks for any tips!
Upvotes: 0
Views: 186
Reputation: 16281
Derive your own class (MySmtpClient) from the SMTPClient class and after the base object is constructed read, decrypt and initialize the password from there. Your child class would vary from the base only in this detail.
I hope that you are using a standard encryption library such as in Encrypt and decrypt a string as using a custom function will probably provide minimal security (custom encryption is rarely solid).
Upvotes: 1