* Move error messages around to clarify the errors.
* Add extra error check when reading a file.
* Seek to the end of a file when writing the signature so the users of
the API don't have to remember to do it.
Change-Id: I2337051b9f9fa8147c5900237deec790dcd92436