def getSignVeryfy(self,**post):
key_sorted = sorted(post.keys())
content = ''
sign_type = post['sign_type']
sign = post['sign']
for key in key_sorted:
if key not in ["sign","sign_type"]:
if post[key]:
content = content + key + "=" + post[key] + "&"
content = content[:-1]
content = content.encode("utf-8")
isSign = False
if sign_type.upper() == "RSA":
directory_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
path = os.path.join(directory_path, 'rsa_public_key.pem')
isSign = func.rsaVerify(content,open(path,'r').read(),sign)
return isSign
评论列表
文章目录