MCPcopy Index your code
hub / github.com/authlib/authlib / thumbprint

Method thumbprint

authlib/jose/rfc7517/base_key.py:98–110  ·  view source on GitHub ↗

Implementation of RFC7638 JSON Web Key (JWK) Thumbprint.

(self)

Source from the content-addressed store, hash-verified

96 return json_dumps(obj)
97
98 def thumbprint(self):
99 """Implementation of RFC7638 JSON Web Key (JWK) Thumbprint."""
100 fields = list(self.REQUIRED_JSON_FIELDS)
101 fields.append("kty")
102 fields.sort()
103 data = OrderedDict()
104
105 for k in fields:
106 data[k] = self.tokens[k]
107
108 json_data = json_dumps(data)
109 digest_data = hashlib.sha256(to_bytes(json_data)).digest()
110 return to_unicode(urlsafe_b64encode(digest_data))
111
112 @classmethod
113 def check_required_fields(cls, data):

Callers 3

as_dictMethod · 0.80
as_dictMethod · 0.80
test_jwk_thumbprintFunction · 0.80

Calls 4

json_dumpsFunction · 0.90
to_bytesFunction · 0.90
to_unicodeFunction · 0.90
urlsafe_b64encodeFunction · 0.90

Tested by 1

test_jwk_thumbprintFunction · 0.64