Use Signature object to sign and validate the XML

The sign and validation process is abstracted to ease the testing
of the client.