def load_hmac_key(): with open(os.path.join(BASE_PATH, 'jwk_hmac.json'), 'r') as infile: keyobj = json.load(infile) return base64url_decode(ensure_bytes(keyobj['k']))
def decode_value(val): decoded = base64url_decode(ensure_bytes(val)) return int_from_bytes(decoded, 'big')