def test_sign_with_id(self): signed_xml = \ top.sign(XML, private_f, KEY_INFO_XML, KEY_SIZE, sig_id_value=SIG_ID) self.assertEqual(signed_xml, EXP_SIGNED_XML_WITH_ID)
def test_verify(self): signed_xml = top.sign(XML, private_f, KEY_INFO_XML, KEY_SIZE) is_verified = top.verify(signed_xml, public_f, KEY_SIZE) self.assertTrue(is_verified)
def test_sign(self): signed_xml = top.sign(XML, private_f, KEY_INFO_XML, KEY_SIZE) self.assertEqual(signed_xml, EXP_SIGNED_XML)
def test_verify(self): signature_xml = top.sign(XML, private_f, KEY_INFO_XML, KEY_SIZE) signed_xml = XML.replace('>', '>'+signature_xml, 1) is_verified = top.verify(signed_xml, public_f, KEY_SIZE) self.assertTrue(is_verified)