python2.x .base64url_decode has a single parameter and incoming data is utf-8.. need to convert so string (#463)

This commit is contained in:
cviecco 2016-10-26 00:50:00 -07:00 committed by kevgliss
parent 4b7fc8551c
commit 490d5b6e6c
1 changed files with 2 additions and 2 deletions

View File

@ -44,8 +44,8 @@ def get_rsa_public_key(n, e):
n = int(binascii.hexlify(jwt.utils.base64url_decode(bytes(n, 'utf-8'))), 16)
e = int(binascii.hexlify(jwt.utils.base64url_decode(bytes(e, 'utf-8'))), 16)
else:
n = int(binascii.hexlify(jwt.utils.base64url_decode(n)), 16)
e = int(binascii.hexlify(jwt.utils.base64url_decode(e, 'utf-8')), 16)
n = int(binascii.hexlify(jwt.utils.base64url_decode(str(n))), 16)
e = int(binascii.hexlify(jwt.utils.base64url_decode(str(e))), 16)
pub = RSAPublicNumbers(e, n).public_key(default_backend())
return pub.public_bytes(