1. 请求方式

请求方式:POSTs

数据格式:multipart/form-data

3. 加密方式

RSA非对称加密

3. 加密规则

API 请求在通过 Internet 发送的过程中极有可能被篡改。为了确保请求未被更改,我们会要求用户在每个请求中带上签名,来校验参数或参数值在传输途中是否发生了更改。

以请求提币接口为例:

如何对请求参数进行签名,用户提交的参数除app_id外,都要参与签名。

首先,将待签名字符串转换为json数据。

例如:对于如下的参数进行json转换

$data = [
            'txid' => '8346c4d4ce52b101cb3b382277417dd8aca297cde2a69f9354c99b531e3',
            'amount' => '10',
            'coin' => 'usdt',
            'game_id' => '1012',
            'award_address' => 'TEjraUp3vqQK4axoK4B29KkaoCK',
            'remark' => '测试提币',
            'timestamp' => 1660325621062
        ];

得到

{"txid":"8346c4d4ce52b101cb3b382277417dd8aca297cde2a69f9354c99b531e3","amount":"10","coin":"usdt","game_id":"1012","award_address":"TEjraUp3vqQK4axoK4B29KkaoCK","remark":"\u6d4b\u8bd5\u63d0\u5e01","timestamp":1660325621062}

然后将得到的json串用我方提供的rsa公钥进行加密,加密后的串进行两次urlencode,得到最终的签名数据

例如 data = GJuoGm4lyX3F0%252FY4NSJ%252F1d13FU8OwhC70bP01FjRhbgPDW6JFbGi7wE%252BSz2DOC1JX82tgr4g%252FogZLSMgiRn2CuV49NC1wyn4nkNEKje1SudfdK%252BkXSedXwyWZh75RjWVH0vWaF0S7bOmlLxFaWotb9idZ2NwYXb8%252BXPPhAhpZlY%253DNBFAcuYeTkp45HX0VYXz4q9FKQE%252BPu6YS%252BLCMbg5o6ZRE4eZoDhKbLIifTWmquBhtXCVdIWx3svZ2KxoKRm02kx7WjnyzTPGDodO5%252B3%252BGfOYCdH2qe4D6IkprZzFZvzNspqEWN%252FYvz5wHViNmyByrNMGouF1OByDHjSrVl3xZTQ%253Difwnfz7j4TPPOY57oY0pLPb4JWCearWp8QtDqGKZcuQSOtRiF0IKCUojMi6OxRK4aOIkFxJ50eP1w8%252BKXwVs4UxQ7lNBAbf8SRDZwRFle6aFWpLEvy8%252F%252FOHj4P%252F5l8CNHvP2XKQP2U0u8egjRjHr8UFgMOgvQ5tLsFOIAehP82g%253D

最终请求数据 data = * app_id = **

results matching ""

    No results matching ""

    results matching ""

      No results matching ""

      results matching ""

        No results matching ""