def dump_jwks(kbl, target):
    res = {"keys": []}
    for kb in kbl:
        # ignore simple keys
        res["keys"].extend([k.to_dict() for k in kb.keys() if
                            k.kty != 'oct' and not k.inactive_since])

    try:
        f = open(target, 'w')
    except IOError:
        (head, tail) = os.path.split(target)
        os.makedirs(head)
        f = open(target, 'w')

    _txt = json.dumps(res)
    f.write(_txt)
    f.close()
Hash a plaintext string using bcrypt.
dataset/ETHPy150Open rohe/pyoidc/src/oic/utils/keyio.py/dump_jwks--crossover with--dataset/ETHPy150Open nickjj/build-a-saas-app-with-flask/catwatch/blueprints/user/models.py/User.encrypt_password