X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2FtestKeypair.py;h=424740ae113224db3a0339c0fcabb04459d62060;hb=5f5f29e2bc00befe5b7b601806ef5a7e44349b75;hp=7ce48e29bc91d491a01a765c59e237f19ac34d6a;hpb=27d1df9592e7d7e94d8d3f22a6fc9d7ee5277dd4;p=sfa.git diff --git a/tests/testKeypair.py b/tests/testKeypair.py old mode 100644 new mode 100755 index 7ce48e29..424740ae --- a/tests/testKeypair.py +++ b/tests/testKeypair.py @@ -1,6 +1,10 @@ +#!/usr/bin/python +import sys +sys.path.append('..') + import unittest -import xmlrpclib -from cert import * +import base64 +from sfa.trust.certificate import Keypair class TestKeypair(unittest.TestCase): def setUp(self): @@ -35,5 +39,14 @@ class TestKeypair(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()