如何使用工具验签

说明:   

工具下载地址:【点击查看】   

工具仅支持异步通知验签,不支持同步验签。  

 注意:工具解压建议放到英文目录下运行。 

验签流程:   

1.解压文件》打开secret_key_tools_RSA_win文件夹》双击运行RSA签名验签工具.bat》选择验签窗口   

2.首先接收到POST数组(以php为例)其他语言也是一样操作方式,返回信息如下

2017-08-31 05:52:07  array (
  'gmt_create' => '2017-08-31 13:51:56',
  'charset' => 'UTF-8',
  'gmt_payment' => '2017-08-31 13:52:03',
  'notify_time' => '2017-08-31 13:52:05',
  'subject' => '测试',
  'sign' => 'Kxpx0Z6qIdwdgq5GDM6EnFaXXgVAvKf96zriCOjVearIS9FgDaRPkfy4uHqbF36EO5rxICoQg9CDNlBVDjGjodzww//ePcv2HhpZGOEQWatvHyzLz9cSBUrUBCQBPbWs9nj7kGd+l5/OWpcpHg1WpSj8pRlwxoWLuw/cTj5DLgOJluhQp9evDnu9t4Fyfkj3fob3LX1t8k3uLAVcUIxv0GL16VIHRqEvRiXv+anWnPcigDhEyaOEpu2mlB5crl8QX9i2OxSNWnNjXx5QRxMx/GBv342GA5osc7xH+91bCOvdp4+svjzKOMP4IPsInbJPqkC5EX5Z5cVdGLwIXkD3UQ==',
  'buyer_id' => '2088102168729244',
  'invoice_amount' => '0.01',
  'version' => '1.0',
  'notify_id' => '1cb8069973eb1ff20aa509493936a8chuq',
  'fund_bill_list' => '[{"amount":"0.01","fundChannel":"ALIPAYACCOUNT"}]',
  'notify_type' => 'trade_status_sync',
  'out_trade_no' => '2017831135121293',
  'total_amount' => '0.01',
  'trade_status' => 'TRADE_SUCCESS',
  'trade_no' => '2017083121001004240200232787',
  'auth_app_id' => '2016072800109035',
  'receipt_amount' => '0.01',
  'point_amount' => '0.00',
  'app_id' => '2016072800109035',
  'buyer_pay_amount' => '0.01',
  'sign_type' => 'RSA2',
  'seller_id' => '2088102168834281',
)

3.要把接收的数组信息拼接成使用&符号连接的字符串,正确拼接示例如下  

注意:要去除空格,fund_bill_list中的数据“,”逗号保留,不要全部替换的时候把这里也替换成了“&”符号

gmt_create=2017-08-31 13:51:56&charset=UTF-8&gmt_payment=2017-08-31 13:52:03¬ify_time=2017-08-31 13:52:05&subject=测试&sign=Kxpx0Z6qIdwdgq5GDM6EnFaXXgVAvKf96zriCOjVearIS9FgDaRPkfy4uHqbF36EO5rxICoQg9CDNlBVDjGjodzww//ePcv2HhpZGOEQWatvHyzLz9cSBUrUBCQBPbWs9nj7kGd+l5/OWpcpHg1WpSj8pRlwxoWLuw/cTj5DLgOJluhQp9evDnu9t4Fyfkj3fob3LX1t8k3uLAVcUIxv0GL16VIHRqEvRiXv+anWnPcigDhEyaOEpu2mlB5crl8QX9i2OxSNWnNjXx5QRxMx/GBv342GA5osc7xH+91bCOvdp4+svjzKOMP4IPsInbJPqkC5EX5Z5cVdGLwIXkD3UQ==&buyer_id=2088102168729244&invoice_amount=0.01&version=1.0¬ify_id=1cb8069973eb1ff20aa509493936a8chuq&fund_bill_list=[{"amount":"0.01","fundChannel":"ALIPAYACCOUNT"}]¬ify_type=trade_status_sync&out_trade_no=2017831135121293&total_amount=0.01&trade_status=TRADE_SUCCESS&trade_no=2017083121001004240200232787&auth_app_id=2016072800109035&receipt_amount=0.01&point_amount=0.00&app_id=2016072800109035&buyer_pay_amount=0.01&sign_type=RSA2&seller_id=2088102168834281

4.把第三步拼接好的字符串放到》响应报文中,把对应的支付宝公钥放到对应的框内注意编码和签名方式要和请求的时候相同》点击开始验签(如下图)     如何使用工具验签

5.验签成功流程结束。

测试使用:   提供个人沙箱支付公钥,可以和第三步拼接的字符串成功验证,方便大家测试对比自己拼接参数是否正确  RSA2沙箱支付宝公钥

MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsmzTjhoCMfORUunhcE1yq2G8JY4pjnSl4hKZITHXBtFA5dMeEwDSLezTlX6QDJl3S3rBKWuXZetNMkJ+eCgIt5X3OAz1vKBM86nUAf3oywQSPi14kXQawambghL98/s0lUvn72HKOIgr53aeJwbdVm3bWD5tYvaYAwMRp5l9YKbLxs3mUXkmD2rpypVdBdav1dcohJt3VnvGhnRbRMbUdl5jXELM4G0Ky5pYTWYd+iT6FuqVZeiYh7MGloJ2j9ijRD/CeSs0XJvmg5ZxSysNK2DNLTRlQj/hXMpUAgav4ngTVHVvzGBzQDLHtIKY8gfjNVz+5PplczlSMKpuVHxC3wIDAQAB

常见问题:  

 验签失败自查:https://openclub.alipay.com/read.php?tid=1598&fid=46   

验证公钥正确性:https://openclub.alipay.com/read.php?tid=1486&fid=46   

如何获取支付宝公钥:https://openclub.alipay.com/read.php?tid=2190&fid=46 


大家如果在测试过程中有什么疑问欢迎在帖子下方追问吐槽 

上一篇:NASA 上线开源网站


下一篇:美团 Android 热更新方案 Robust 开源,包含自动化补丁工具