main.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:odooalipay 作者: Primary-Traxex 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号