Exemplo n.º 1
0
def hmac(key, data, algo='sha1'):
    md = getattr(m2, algo, None)
    if md is None:
        raise ValueError, ('unknown algorithm', algo)
    return m2.hmac(key, data, md())
Exemplo n.º 2
0
def hmac(key, data, algo="sha1"):
    md = getattr(m2, algo, None)
    if md is None:
        raise ValueError("unknown algorithm", algo)
    return m2.hmac(key, data, md())
Exemplo n.º 3
0
 def _hmac(self, key, data):
     return binascii.b2a_base64(m2.hmac(key, data, m2.sha1()))[:-1]
Exemplo n.º 4
0
def hmac(key, data, algo='sha1'):
    md = getattr(m2, algo, None)
    if md is None:
        raise ValueError, ('unknown algorithm', algo)
    return m2.hmac(key, data, md())