示例#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)
示例#2
0
文件: EVP.py 项目: pywbem/m2crypto
 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)
示例#3
0
 def reset(self, key):
     m2.hmac_init(self.ctx, key, self.md)
示例#4
0
文件: EVP.py 项目: pywbem/m2crypto
 def reset(self, key):
     m2.hmac_init(self.ctx, key, self.md)