当前位置: 首页>>代码示例>>Python>>正文


Python KeyBundle.do_keys方法代码示例

本文整理汇总了Python中oic.utils.keyio.KeyBundle.do_keys方法的典型用法代码示例。如果您正苦于以下问题:Python KeyBundle.do_keys方法的具体用法?Python KeyBundle.do_keys怎么用?Python KeyBundle.do_keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在oic.utils.keyio.KeyBundle的用法示例。


在下文中一共展示了KeyBundle.do_keys方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: init_keyjar

# 需要导入模块: from oic.utils.keyio import KeyBundle [as 别名]
# 或者: from oic.utils.keyio.KeyBundle import do_keys [as 别名]
def init_keyjar():
    # Keys that are kept by the AS
    kb = KeyBundle()
    kb.do_keys(JWKS["keys"])
    keyjar = KeyJar()
    keyjar.add_kb('', kb)
    return keyjar
开发者ID:Omosofe,项目名称:pyoidc,代码行数:9,代码来源:test_pop.py

示例2: store_key

# 需要导入模块: from oic.utils.keyio import KeyBundle [as 别名]
# 或者: from oic.utils.keyio.KeyBundle import do_keys [as 别名]
    def store_key(self, key):
        kb = KeyBundle()
        kb.do_keys([key])

        # Store key with thumbprint as key
        key_thumbprint = b64e(kb.keys()[0].thumbprint('SHA-256')).decode(
            'utf8')
        self.thumbprint2key[key_thumbprint] = key
        return key_thumbprint
开发者ID:Omosofe,项目名称:pyoidc,代码行数:11,代码来源:pop.py

示例3: test_reload

# 需要导入模块: from oic.utils.keyio import KeyBundle [as 别名]
# 或者: from oic.utils.keyio.KeyBundle import do_keys [as 别名]
def test_reload():
    """
    Emulates what happens if you fetch keys from a remote site and
    you get back the same JWKS as the last time.
    """
    _jwks = JWK0

    kb = KeyBundle()
    kb.imp_jwks = _jwks
    kb.do_keys(kb.imp_jwks['keys'])

    assert len(kb) == 1

    kb.do_keys(kb.imp_jwks['keys'])

    assert len(kb) == 1
开发者ID:,项目名称:,代码行数:18,代码来源:

示例4: add_software_statement

# 需要导入模块: from oic.utils.keyio import KeyBundle [as 别名]
# 或者: from oic.utils.keyio.KeyBundle import do_keys [as 别名]
def add_software_statement(oper, arg):
    argkeys = list(arg.keys())
    kwargs = {}

    tre = oper.conf.TRUSTED_REGISTRATION_ENTITY
    iss = tre['iss']
    kb = KeyBundle()
    kb.imp_jwks = json.load(open(tre['jwks']))
    kb.do_keys(kb.imp_jwks['keys'])
    oper.conv.entity.keyjar.add_kb(iss, kb)

    if arg['redirect_uris'] is None:
        kwargs['redirect_uris'] = oper.conv.entity.redirect_uris
    else:
        kwargs['redirect_uris'] = arg['redirect_uris']
    argkeys.remove('redirect_uris')

    if 'jwks_uri' in argkeys:
        if arg['jwks_uri'] is None:
            kwargs['jwks_uri'] = oper.conv.entity.jwks_uri
        else:
            kwargs['jwks_uri'] = arg['jwks_uri']
        argkeys.remove('jwks_uri')
    elif 'jwks' in argkeys:
        if arg['jwks'] is None:
            kwargs['jwks'] = {
                "keys": oper.conv.entity.keyjar.dump_issuer_keys("")}
        else:
            kwargs['jwks'] = arg['jwks']
        argkeys.remove('jwks')

    for a in argkeys:
        kwargs[a] = arg[a]

    oper.req_args['software_statement'] = make_software_statement(
        oper.conv.entity.keyjar, iss=iss, owner=iss, **kwargs)
开发者ID:rohe,项目名称:otest,代码行数:38,代码来源:func.py

示例5: KeyBundle

# 需要导入模块: from oic.utils.keyio import KeyBundle [as 别名]
# 或者: from oic.utils.keyio.KeyBundle import do_keys [as 别名]
        OAS.baseurl = "%s:%d" % (config.baseurl, args.port)

    if not OAS.baseurl.endswith("/"):
        OAS.baseurl += "/"

    # load extra keys
    try:
        extern = config.TRUSTED_REGISTRATION_ENTITIES
    except AttributeError:
        pass
    else:
        for ent in extern:
            iss = ent['iss']
            kb = KeyBundle()
            kb.imp_jwks = json.load(open(ent['jwks']))
            kb.do_keys(kb.imp_jwks['keys'])
            OAS.keyjar.add_kb(iss, kb)

    LOGGER.debug("URLS: '%s" % (URLS,))

    # Initiate the web server
    SRV = wsgiserver.CherryPyWSGIServer(('0.0.0.0', args.port), application)
    https = ""
    if config.SERVICE_URL.startswith("https"):
        https = " using HTTPS"
        # SRV.ssl_adapter = ssl_pyopenssl.pyOpenSSLAdapter(
        #     config.SERVER_CERT, config.SERVER_KEY, config.CERT_CHAIN)
        SRV.ssl_adapter = BuiltinSSLAdapter(config.SERVER_CERT,
                                            config.SERVER_KEY,
                                            config.CERT_CHAIN)
开发者ID:StudienprojektUniTrier,项目名称:Authorization-Server,代码行数:32,代码来源:AS_POP.py


注:本文中的oic.utils.keyio.KeyBundle.do_keys方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。