git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9751af1
)
add functions to sign and verify strings using a key
author
Scott Baker
<bakers@cs.arizona.edu>
Fri, 10 Apr 2009 18:53:06 +0000
(18:53 +0000)
committer
Scott Baker
<bakers@cs.arizona.edu>
Fri, 10 Apr 2009 18:53:06 +0000
(18:53 +0000)
tests/testKeypair.py
patch
|
blob
|
history
diff --git
a/tests/testKeypair.py
b/tests/testKeypair.py
index
7ce48e2
..
6562316
100644
(file)
--- a/
tests/testKeypair.py
+++ b/
tests/testKeypair.py
@@
-1,5
+1,6
@@
import unittest
import xmlrpclib
+import base64
from cert import *
class TestKeypair(unittest.TestCase):
@@
-35,5
+36,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()