|
char data[256];
int data_len = 0;
char base64[512];
int base64_len;
char encrypt[512];
int encrypt_len = 0;
data_len = sizeof(data);
memset(data, 0, sizeof(data));
encrypt_len = sizeof(encrypt);
memset(encrypt, 0, sizeof(encrypt));
base64_len = sizeof(base64);
memset(base64, 0, sizeof(base64));
// 获取需要字符串
BVCSP_GetEncryptedData(data, &data_len);
// Base64(RSA(data))
BVCU_Result bvresult = BVCSP_EncryptData((char *)n, (char *)e, data, data_len, encrypt, &encrypt_len);
if (BVCU_Result_SUCCEEDED(bvresult))
{
base64_len = base64_encode((const unsigned char*)encrypt, encrypt_len, base64);
strcpy(param.appInfo.appId, app_id);
param.appInfo.ciph_data = base64;
param.appInfo.ciph_len = strlen(base64);
} else {
printf( "BVCSP_EncryptData return %d\n", bvresult );
}
}
BVCSP_Auth(¶m);
如上认证时,在接口BVCSP_EncryptData经常会返回失败,错误提示如下:
BVCSP_EncryptData return -65536
[E] [09-04 15:58:22] [bvr_auth:0246] no appInfo.appId
ThreadNetwork.cpp, line 502, function CBVCSPThreadNetwork::Auth, auth error=-2
, 2020-09-04 15:58:22
ThreadNetwork.cpp, line 502, function CBVCSPThreadNetwork::Auth, auth error=-2
, 2020-09-04 15:58:22
BVCSP_Login: -65522 |
|