PHP code example of tencent / tls-sig-api
1. Go to this page and download the library: Download tencent/tls-sig-api library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tencent / tls-sig-api example snippets
$api = new Tencent\TLSSigAPI();
$api->SetAppid(140000000);
$private = file_get_contents(dirname(__FILE__).DIRECTORY_SEPARATOR.'private_key');
$api->SetPrivateKey($private);
$sig = $api->genSig('xiaojun');
var_export($sig);
$api = new Tencent\TLSSigAPI();
$api->SetAppid(140000000);
$private = file_get_contents(dirname(__FILE__).DIRECTORY_SEPARATOR.'private_key');
$api->SetPrivateKey($private);
$sig = $api->genSig('xiaojun', 24*3600*180);
var_export($sig);