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


Python KEYS.load_from_url方法代码示例

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


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

示例1: get_jwks_keys

# 需要导入模块: from jwkest.jwk import KEYS [as 别名]
# 或者: from jwkest.jwk.KEYS import load_from_url [as 别名]
    def get_jwks_keys(self):
        keys = KEYS()
        keys.load_from_url(self.jwks_uri())

        # Add client secret as oct key so it can be used for HMAC signatures
        client_id, client_secret = self.get_key_and_secret()
        keys.add({'key': client_secret, 'kty': 'oct'})
        return keys
开发者ID:BeatrizFerreira,项目名称:EP1DAS,代码行数:10,代码来源:open_id_connect.py

示例2: signing_keys

# 需要导入模块: from jwkest.jwk import KEYS [as 别名]
# 或者: from jwkest.jwk.KEYS import load_from_url [as 别名]
    def signing_keys(self):
        if self.signing_alg == self.RS256:
            # TODO perform caching, OBVIOUS
            key = KEYS()
            key.load_from_url(self.jwks_uri)
            rsa_key = key.as_dict()['RSA']
            return rsa_key

        return [SYMKey(key=str(self.client_secret))]
开发者ID:cmoran,项目名称:django-oidc-auth,代码行数:11,代码来源:models.py

示例3: get_jwks_keys

# 需要导入模块: from jwkest.jwk import KEYS [as 别名]
# 或者: from jwkest.jwk.KEYS import load_from_url [as 别名]
    def get_jwks_keys(self):
        """
        Returns the keys used by the IdP.

        Merges client secret into JWK set from server
        Response is cached for 24 hours.
        """
        keys = KEYS()
        keys.load_from_url(self.JWKS_URI)

        # Add client secret as oct key so it can be used for HMAC signatures
        _client_id, client_secret = self.get_key_and_secret()
        keys.add({'key': client_secret, 'kty': 'oct'})
        return keys
开发者ID:digideskio,项目名称:mit-datahub,代码行数:16,代码来源:oidc.py

示例4: _get_keys

# 需要导入模块: from jwkest.jwk import KEYS [as 别名]
# 或者: from jwkest.jwk.KEYS import load_from_url [as 别名]
    def _get_keys(self):
        if "jwk" in self:
            return [self["jwk"]]
        elif "jku" in self:
            keys = KEYS()
            keys.load_from_url(self["jku"])
            return keys.as_dict()
        elif "x5u" in self:
            try:
                return {"rsa": [load_x509_cert(self["x5u"], {})]}
            except Exception:
                # ca_chain = load_x509_cert_chain(self["x5u"])
                pass

        return {}
开发者ID:tpazderka,项目名称:pyjwkest,代码行数:17,代码来源:jws.py

示例5: _get_keys

# 需要导入模块: from jwkest.jwk import KEYS [as 别名]
# 或者: from jwkest.jwk.KEYS import load_from_url [as 别名]
    def _get_keys(self):
        logger.debug("_get_keys(): self._dict.keys={0}".format(
            self._dict.keys()))

        if "jwk" in self:
            return [self["jwk"]]
        elif "jku" in self:
            keys = KEYS()
            keys.load_from_url(self["jku"])
            return keys.as_dict()
        elif "x5u" in self:
            try:
                return {"rsa": [load_x509_cert(self["x5u"], {})]}
            except Exception:
                # ca_chain = load_x509_cert_chain(self["x5u"])
                pass

        return {}
开发者ID:jespino,项目名称:pyjwkest,代码行数:20,代码来源:jws.py

示例6: KEYS

# 需要导入模块: from jwkest.jwk import KEYS [as 别名]
# 或者: from jwkest.jwk.KEYS import load_from_url [as 别名]
                           kid=_kid))
    if args.hmac_key:
        keys.append(SYMKey(key=args.hmac_key))

    if args.jwk:
        kspec = json.loads(open(args.jwk).read())
        keys.append(keyrep(kspec))

    if args.jwks:
        _k = KEYS()
        _k.load_jwks(open(args.jwks).read())
        keys.extend(_k._keys)

    if args.jwks_url:
        _k = KEYS()
        _k.load_from_url(args.jwks_url, False)
        keys.extend(_k._keys)

    if not keys:
        exit(-1)

    if args.msg_file:
        message = open(args.msg_file).read().strip("\n")
    elif args.message == "-":
        message = sys.stdin.read()
    else:
        message = args.message

    if args.sign:
        _msg = sign(message, keys, args.alg, args.msgtype)
        if args.encrypt:
开发者ID:shubhanus,项目名称:taiga,代码行数:33,代码来源:jwkutil.py

示例7: jwks

# 需要导入模块: from jwkest.jwk import KEYS [as 别名]
# 或者: from jwkest.jwk.KEYS import load_from_url [as 别名]
 def jwks(self):
     keys = KEYS()
     keys.load_from_url(self.oidc_config['jwks_uri'])
     return keys
开发者ID:jhuapl-boss,项目名称:drf-oidc-auth,代码行数:6,代码来源:authentication.py


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