P2P连线的密码验证
更新日期:2025/2/13
概述
在SDK数据传输中,加密是安全保证的第一道屏障。除此之外,我们需要使用连线密码来保证用户设备不被非法访问。目前SDK中涉及到的密码有以下几种形式:
- iotc authkey
- av password/av token
- rdt password
- tunnel password
iotc authkey
API | APP端 | 设备端 | ||
---|---|---|---|---|
IOTC_Connect_ByUID_Parallel | IOTC_Connect_ByUIDEx | IOTC_Device_Login | IOTC_Device_LoginEx | |
是否支持Authkey | × | √ | × | √ |
av password/token auth
API | APP端 | 设备端 | ||
---|---|---|---|---|
avClientStart/avClientStart2 | avClientStartEx | avServStart/avServStart2/avServStart3 | avServStartEx | |
是否支持av password | √ | √ | √ | √ |
是否支持av token | × | √ | × | √ |
rdt password auth
API | APP端 | 设备端 | ||
---|---|---|---|---|
RDT_Create | RDT_Client_Create | RDT_Create | RDT_Server_Create | |
是否支持rdt password | × | √ | × | √ |
tunnel password auth
目前P2PTunnelAPI连线相关接口,都支持通过密码验证。
合理的auth设计
我们强烈建议开启Authkey,然后搭配其他模块的password使用,但是多个auth的password,对用户可能不太友好,所以一般会有以下几种使用方式:
- 统一的authkey,非固定的password。
- 非统一的authkey,固定的password。
- 非统一的authkey,非固定的password。
前面两种方式都比较好理解,这里针对第三种方式,设计的时候,可以把authkey与password关联起来,把authkey设定为password的一部分。
比如说密码设定为:hfjhkfjk@12345678,那么authkey可以取其中的任意的8位,比如说"hfjhkfjk","12345678"或者"kfjk@123"等等。