2017 © Pedro Peláez
 

library tls-sig-api

image

tencent/tls-sig-api

  • Tuesday, April 10, 2018
  • by wangpeiwen
  • Repository
  • 44 Watchers
  • 2 Stars
  • 50 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 733 % Grown

The README.md

composer 集成

{
  "require": {
    "tencent/tls-sig-api": "1.0"
  }
}

调用接口

默认过期时间

require 'vendor/autoload.php';

$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);

指定过期时间

require 'vendor/autoload.php';

$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);

源代码集成

require 'vendor/autoload.php';

直接上面的 require 语句替换为下面的, (*1)

require "TLSSigAPI.php";

注意语句的路径需要随着 api 文件的存放路径而修改。, (*2)

The Versions

10/04 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Development Requires

by okhowang(王沛文)

10/04 2018

v1.0

1.0.0.0

  Sources   Download

MIT

The Development Requires

by okhowang(王沛文)