本文整理匯總了Python中oic.utils.jwt.JWT.sign_alg方法的典型用法代碼示例。如果您正苦於以下問題:Python JWT.sign_alg方法的具體用法?Python JWT.sign_alg怎麽用?Python JWT.sign_alg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類oic.utils.jwt.JWT
的用法示例。
在下文中一共展示了JWT.sign_alg方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: pack_metadata_statement
# 需要導入模塊: from oic.utils.jwt import JWT [as 別名]
# 或者: from oic.utils.jwt.JWT import sign_alg [as 別名]
def pack_metadata_statement(self, metadata, keyjar=None, iss=None, alg='',
**kwargs):
"""
:param metas: Original metadata statement as a MetadataStatement
instance
:param keyjar: KeyJar in which the necessary keys should reside
:param alg: Which signing algorithm to use
:param kwargs: Additional metadata statement attribute values
:return: A JWT
"""
if iss is None:
iss = self.iss
if keyjar is None:
keyjar = self.keyjar
# Own copy
_metadata = copy.deepcopy(metadata)
_metadata.update(kwargs)
_jwt = JWT(keyjar, iss=iss, msgtype=_metadata.__class__)
if alg:
_jwt.sign_alg = alg
return _jwt.pack(cls_instance=_metadata)