采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
https://openapi.alipaydev.com/gateway.do?app_id=123456&biz_content=%7B%22subject%22%3A%22%5Cu6d4b%5Cu8bd5%5Cu8ba2%5Cu53552%22%2C%22out_trade_no%22%3A%2220170202sss%22%2C%22total_amount%22%3A100%2C%22product_code%22%3A%22FAST_INSTANT_TRADE_PAY%22%7D&charset=utf-8&method=alipay.trade.page.pay¬ify_url=http%3A%2F%2F127.0.0.1%3A8000%2Falipay%2Freturn%2F&return_url=http%3A%2F%2F127.0.0.1%3A8000%2Falipay%2Freturn%2F&sign_type=RSA2×tamp=2023-02-16+03%3A38%3A05&version=1.0&sign=XLi5ZGn5lY9eTeAf0XbOm1jOcB5fNb7J%2FiHK2KtupNwZeWL1rpI3OpHxkWyuCS85M1JgxFGs0bXLtFJMv6lNwgNgvlSduJTjYbqL1UzwNYk04xAIYhTn%2BE%2BiFXNMWuf0lkR9GCMY6E4SGelds%2BqkysslcvA6N%2Bo3rmn%2B6MAE0sEzuA4mpbNd%2FIh2HJcXkQ4eHVGI7JA19vaoFWgFXTGe9zogaULiOrQCGr%2Bugm5QZ%2B%2Bqn480M7srnqZjUjteSvWORZ0HO5cNnLHOYVhc2ZwHYgeTMXK%2Bnxz%2FWnw48QuB4l1yWs9iP7CTUzLtHVuCA864F3ASrluJohcxcVFhVLhCDw%3D%3D
其中的签名sign=“”,里面是内容是先用哈希算法SHA256算出摘要,再用RSA2的应用私钥加密的,对吧?
那前面的app_id=123456&biz_content=%7B%22subject%22%3A%22%5Cu6d4b%5Cu8bd5%5Cu8ba2%5Cu53552%22%2C%22out_trade_no%22%3A%2220170202sss%22%2C%22total_amount%22%3A100%2C%22product_code%22%3A%22FAST_INSTANT_TRADE_PAY%22%7D&charset=utf-8&method=alipay.trade.page.pay¬ify_url=http%3A%2F%2F127.0.0.1%3A8000%2Falipay%2Freturn%2F&return_url=http%3A%2F%2F127.0.0.1%3A8000%2Falipay%2Freturn%2F&sign_type=RSA2×tamp=2023-02-16+03%3A38%3A05&version=1.0&
这一串是直接用RSA2进行加密的吗?看上去也是密文,我之前以为会用明文
支付宝给服务器发送的return_url里面的sign,用的是支付宝公钥加密?
支付宝给你的url中带的token是用支付宝的私钥加密的,如果是使用了公钥加密那么别人就能伪造请求了,所以加密的密钥不能让别人知道,所以是私钥加密,但是你需要解密出来,所以你要用支付宝的公钥解密来确定是不是支付宝的私钥加密的
这个链接里面,前面关于请求参数的部分,用的是支付宝公钥加密?
后面的sign,先SHA256算出摘要,然后用RSA2中的应用私钥加密?
Django REST framework课程视频,RESTFul API前后端分离开发
10.3k 1
4.3k 51
1.3k 19
969 19
1.7k 19