本文整理汇总了Python中jwkest.jwk.KEYS.as_dict方法的典型用法代码示例。如果您正苦于以下问题:Python KEYS.as_dict方法的具体用法?Python KEYS.as_dict怎么用?Python KEYS.as_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jwkest.jwk.KEYS
的用法示例。
在下文中一共展示了KEYS.as_dict方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: signing_keys
# 需要导入模块: from jwkest.jwk import KEYS [as 别名]
# 或者: from jwkest.jwk.KEYS import as_dict [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))]
示例2: _get_keys
# 需要导入模块: from jwkest.jwk import KEYS [as 别名]
# 或者: from jwkest.jwk.KEYS import as_dict [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 {}
示例3: _get_keys
# 需要导入模块: from jwkest.jwk import KEYS [as 别名]
# 或者: from jwkest.jwk.KEYS import as_dict [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 {}