I have code for a class that will manage an OAuth authentication key, included below. Because this class's functionality means it needs to be considered with regards to security, I wanted to check to make sure that all is as it should be (or figure out what ought to be changed), and there aren't any extra risks anywhere. I'm looking for advice on best practice, and I am reasonably sure that there aren't any major bugs in it.
This code will end up running as part of a daemon used to update a database of reports, just a simple tool for automating a task currently performed by hand, so it doesn't need to be bullet proof. Nor does it need to be as secure as you need for an application that will be distributed to hundreds of customers. I just need to be sure it isn't likely to cause our server to become compromised, and that it isn't too easy to break.
Also, if anyone wants to have this code for their own use, just ask me, I just need to check with my boss to make sure it's OK before I can release it for use by anyone else (the company does mechanical contracting, not software development).