def rsa_public_key_from_map(jwk):
nb64url = jwk['n'].encode('utf-8')
eb64url = jwk['e'].encode('utf-8')
n = util.parse_rsa_modules_params(nb64url)
e = util.parse_rsa_public_exponent_param(eb64url)
public_key = rsa.RSAPublicNumbers(e, n).public_key(default_backend())
return RSAPublicKey(public_key)
评论列表
文章目录