Example #1
0
 def __init__(self, key, algo='sha1'):
     md = getattr(m2, algo, None)
     if md is None:
         raise ValueError, ('unknown algorithm', algo)
     self.md = md()
     self.ctx = m2.hmac_ctx_new()
     m2.hmac_init(self.ctx, key, self.md)
Example #2
0
 def __init__(self, key, algo="sha1"):
     md = getattr(m2, algo, None)
     if md is None:
         raise ValueError("unknown algorithm", algo)
     self.md = md()
     self.ctx = m2.hmac_ctx_new()
     m2.hmac_init(self.ctx, key, self.md)
Example #3
0
 def reset(self, key):
     m2.hmac_init(self.ctx, key, self.md)
Example #4
0
 def reset(self, key):
     m2.hmac_init(self.ctx, key, self.md)