Skip to content

Double Base64 Encoding of JWK Thumbprint When Assigning kid #183

@lionick

Description

@lionick

The JWK.thumbprint() function already returns a base64url-encoded hash (via b64e()).

return b64e(DIGEST_HASH[hash_function](_json))

However, when code later does:
self.kid = b64e(self.thumbprint("SHA-256")).decode("utf8")
it is applying b64e a second time on the thumbprint, which is already base64url-encoded.

(

self.kid = b64e(self.thumbprint("SHA-256")).decode("utf8")
)

Is this something made on purpose?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions