'A basic test for the HMAC class.'

def testHMAC(self):

    key = rdf_crypto.EncryptionKey.GenerateKey()
    message = 'Hello    World!'
    h = rdf_crypto.HMAC(key)
    signature = h.HMAC(message)
    h.Verify(message, signature)
    broken_message = (message + '!')
    self.assertRaises(rdf_crypto.VerificationError, h.Verify, broken_message, signature)
    broken_signature = self._Tamper(signature)
    self.assertRaises(rdf_crypto.VerificationError, h.Verify, 'Hello    World!', broken_signature)
