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