Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 911 Bytes

File metadata and controls

24 lines (16 loc) · 911 Bytes

Tencent Login Service Signature API (aka. TLSSigAPI)

v0.1.1-rc.1

Currently We provide only the TLSSigAPIv2 using HMAC-SHA256 as in describe on TecentYun document(for server use only).

Implement base on this code

Usage

use tls_sig_api::TlsSigApiVer2;
use chrono::Duration;

let mock_key = "5bd2850fff3ecb11d7c805251c51ee463a25727bddc2385f3fa8bfee1bb93b5e";
let signer = TlsSigApiVer2::new(0, mock_key);

let identifier = "10086";
let expire = Duration::hours(2);
let userbuf = "This' really a good crate!";

let digest = signer.gen_sign(identifier, expire, Some(userbuf));
println!("{}", digest);