Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 def test_sign(self):
   signed_xml = top.sign(XML, private_f, KEY_INFO_XML, KEY_SIZE)
   self.assertEqual(signed_xml, EXP_SIGNED_XML)
Esempio n. 4
0
 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)
Esempio n. 5
0
 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)
Esempio n. 6
0
 def test_sign(self):
     signed_xml = top.sign(XML, private_f, KEY_INFO_XML, KEY_SIZE)
     self.assertEqual(signed_xml, EXP_SIGNED_XML)
Esempio n. 7
0
 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)