add functions to sign and verify strings using a key
[sfa.git] / tests / testKeypair.py
index 0f1822a..6562316 100644 (file)
@@ -1,8 +1,9 @@
 import unittest
 import xmlrpclib
+import base64
 from cert import *
 
-class TestCert(unittest.TestCase):
+class TestKeypair(unittest.TestCase):
    def setUp(self):
       pass
 
@@ -35,5 +36,14 @@ class TestCert(unittest.TestCase):
       pk = k.get_openssl_pkey()
       self.assert_(pk != None)
 
+   def test_sign_verify(self):
+      k = Keypair()
+      k.create()
+
+      data = "this is a test"
+      sig = k.sign_string(data)
+
+      print k.verify_string(data, sig)
+
 if __name__ == "__main__":
     unittest.main()