You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project is the php implementation of tls-sig-api-v2. Previous asymmetric keys cannot use APIs of this version. To enable them to use APIs of this version,[see here](https://github.com/tencentyun/tls-sig-api-php)。
Copy file name to clipboardExpand all lines: src/TLSSigAPIv2.php
+142-1Lines changed: 142 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,16 @@ class TLSSigAPIv2 {
21
21
* @throws \Exception
22
22
*/
23
23
24
+
/**
25
+
* Function: Used to issue UserSig that is required by the TRTC and IM services.
26
+
*
27
+
* Parameter description:
28
+
* @param userid - User ID. The value can be up to 32 bytes in length and contain letters (a-z and A-Z), digits (0-9), underscores (_), and hyphens (-).
29
+
* @param expire - UserSig expiration time, in seconds. For example, 86400 indicates that the generated UserSig will expire one day after being generated.
* Used to issue PrivateMapKey that is optional for room entry.
66
+
* PrivateMapKey must be used together with UserSig but with more powerful permission control capabilities.
67
+
* - UserSig can only control whether a UserID has permission to use the TRTC service. As long as the UserSig is correct, the user with the corresponding UserID can enter or leave any room.
68
+
* - PrivateMapKey specifies more stringent permissions for a UserID, including whether the UserID can be used to enter a specific room and perform audio/video upstreaming in the room.
69
+
* To enable stringent PrivateMapKey permission bit verification, you need to enable permission key in TRTC console > Application Management > Application Info.
70
+
*
71
+
* Parameter description:
72
+
* userid - User ID. The value can be up to 32 bytes in length and contain letters (a-z and A-Z), digits (0-9), underscores (_), and hyphens (-).
73
+
* roomid - ID of the room to which the specified UserID can enter.
74
+
* expire - PrivateMapKey expiration time, in seconds. For example, 86400 indicates that the generated PrivateMapKey will expire one day after being generated.
75
+
* privilegeMap - Permission bits. Eight bits in the same byte are used as the permission switches of eight specific features:
76
+
* - Bit 1: 0000 0001 = 1, permission for room creation
77
+
* - Bit 2: 0000 0010 = 2, permission for room entry
78
+
* - Bit 3: 0000 0100 = 4, permission for audio sending
79
+
* - Bit 4: 0000 1000 = 8, permission for audio receiving
80
+
* - Bit 5: 0001 0000 = 16, permission for video sending
81
+
* - Bit 6: 0010 0000 = 32, permission for video receiving
82
+
* - Bit 7: 0100 0000 = 64, permission for substream video sending (screen sharing)
83
+
* - Bit 8: 1000 0000 = 200, permission for substream video receiving (screen sharing)
84
+
* - privilegeMap == 1111 1111 == 255: Indicates that the UserID has all feature permissions of the room specified by roomid.
85
+
* - privilegeMap == 0010 1010 == 42: Indicates that the UserID has only the permissions to enter the room and receive audio/video data.
* Used to issue PrivateMapKey that is optional for room entry.
120
+
* PrivateMapKey must be used together with UserSig but with more powerful permission control capabilities.
121
+
* - UserSig can only control whether a UserID has permission to use the TRTC service. As long as the UserSig is correct, the user with the corresponding UserID can enter or leave any room.
122
+
* - PrivateMapKey specifies more stringent permissions for a UserID, including whether the UserID can be used to enter a specific room and perform audio/video upstreaming in the room.
123
+
* To enable stringent PrivateMapKey permission bit verification, you need to enable permission key in TRTC console > Application Management > Application Info.
124
+
*
125
+
* Parameter description:
126
+
* @param userid - User ID. The value can be up to 32 bytes in length and contain letters (a-z and A-Z), digits (0-9), underscores (_), and hyphens (-).
127
+
* @param roomstr - ID of the room to which the specified UserID can enter.
128
+
* @param expire - PrivateMapKey expiration time, in seconds. For example, 86400 indicates that the generated PrivateMapKey will expire one day after being generated.
129
+
* @param privilegeMap - Permission bits. Eight bits in the same byte are used as the permission switches of eight specific features:
130
+
* - Bit 1: 0000 0001 = 1, permission for room creation
131
+
* - Bit 2: 0000 0010 = 2, permission for room entry
132
+
* - Bit 3: 0000 0100 = 4, permission for audio sending
133
+
* - Bit 4: 0000 1000 = 8, permission for audio receiving
134
+
* - Bit 5: 0001 0000 = 16, permission for video sending
135
+
* - Bit 6: 0010 0000 = 32, permission for video receiving
136
+
* - Bit 7: 0100 0000 = 64, permission for substream video sending (screen sharing)
137
+
* - Bit 8: 1000 0000 = 200, permission for substream video receiving (screen sharing)
138
+
* - privilegeMap == 1111 1111 == 255: Indicates that the UserID has all feature permissions of the room specified by roomid.
139
+
* - privilegeMap == 0010 1010 == 42: Indicates that the UserID has only the permissions to enter the room and receive audio/video data.
0 commit comments