23 lines
767 B
C++
23 lines
767 B
C++
#pragma once
|
||
|
||
#include <string>
|
||
#include <cstdint>
|
||
|
||
// 生成 TRTC UserSig(TLS-SigAPIv2)
|
||
// 参数:
|
||
// - user_id : 用户 ID,对应 TLS.identifier
|
||
// - sdk_app_id : 控制台创建的 TRTC 应用 SDKAppID
|
||
// - secret_key : 控制台获取的密钥 SecretKey
|
||
// - expire : 过期时间(秒),例如 7 * 24 * 60 * 60
|
||
//
|
||
// 返回:
|
||
// - 用于 TRTC 鉴权的 UserSig 字符串
|
||
//
|
||
// 说明:
|
||
// - 该函数仅做算法封装,不做任何网络/IO 操作
|
||
// - 推荐在服务端调用本函数生成 UserSig,再下发到客户端
|
||
std::string GenerateUserSig(const std::string& user_id,
|
||
int sdk_app_id,
|
||
const std::string& secret_key,
|
||
std::uint32_t expire);
|