We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3092472 commit d7590baCopy full SHA for d7590ba
src/cryptojwt/jwk/hmac.py
@@ -62,8 +62,10 @@ def __init__(
62
elif self.key and not self.k:
63
self.k = b64e(self.key)
64
65
- if self.k and self.key and self.k != b64e(self.key):
66
- raise JWKException("k and key don't match")
+ if self.k and self.key:
+ _k_bytes = self.k.encode("utf-8") if isinstance(self.k, str) else self.k
67
+ if _k_bytes != b64e(self.key):
68
+ raise JWKException("k and key don't match")
69
70
if len(self.key) < 16:
71
raise UnsupportedAlgorithm("client_secret too short, it should be at least 16 digits")
0 commit comments