added compute_hash() method
authorTony Mack <tmack@cs.princeton.edu>
Wed, 14 Oct 2009 00:23:42 +0000 (00:23 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Wed, 14 Oct 2009 00:23:42 +0000 (00:23 +0000)
sfa/trust/certificate.py

index 5a32243..54d98eb 100644 (file)
@@ -203,6 +203,9 @@ class Keypair:
       k.verify_update(data)
       return M2Crypto.m2.verify_final(k.ctx, base64.b64decode(sig), k.pkey)
 
+   def compute_hash(self, value):
+      return self.sign_string(str(value))      
+
 ##
 # The certificate class implements a general purpose X509 certificate, making
 # use of the appropriate pyOpenSSL or M2Crypto abstractions. It also adds