From: Tony Mack <tmack@cs.princeton.edu> Date: Wed, 14 Oct 2009 00:23:42 +0000 (+0000) Subject: added compute_hash() method X-Git-Tag: sfa-0.9-6~195 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8febbc657bb2b99934ef3c162d49052ab48e5a84;p=sfa.git added compute_hash() method --- diff --git a/sfa/trust/certificate.py b/sfa/trust/certificate.py index 5a322430..54d98eb1 100644 --- a/sfa/trust/certificate.py +++ b/sfa/trust/certificate.py @@ -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