I have got a username & password combo that I will be using to access a secured server via java code.
My idea is to:
- Store encrypted credentials externally
- Prompt user for the decryption password upon execution
- Store the decrypted credentials in a char array directly before use
- Connect to DB using the credentials
- Replace char arrays with zeros after use
Is this the recommended way of performing this kind of task?
I read that credentials should be stored externally, how should these be stored?