8 from sfa.trust.certificate import Keypair
10 class TestKeypair(unittest.TestCase):
18 def testSaveLoadFile(self):
22 k.save_to_file("test.key")
25 k2.load_from_file("test.key")
27 self.assertEqual(k.as_pem(), k2.as_pem())
29 def test_get_m2_pkey(self):
34 self.assert_(m2 != None)
36 def test_get_openssl_pkey(self):
40 pk = k.get_openssl_pkey()
41 self.assert_(pk != None)
43 def test_sign_verify(self):
47 data = "this is a test"
48 sig = k.sign_string(data)
50 print k.verify_string(data, sig)
52 if __name__ == "__main__":