• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "hichain_auth_connector_mock.h"
17 
18 #include "gtest/gtest.h"
19 
20 namespace OHOS {
21 namespace DistributedHardware {
QueryCredential(std::string & localUdid,int32_t osAccountId,int32_t peerOsAccountId)22 bool HiChainAuthConnector::QueryCredential(std::string &localUdid, int32_t osAccountId, int32_t peerOsAccountId)
23 {
24     return DmHiChainAuthConnector::dmHiChainAuthConnector->QueryCredential(localUdid, osAccountId, peerOsAccountId);
25 }
26 
AuthDevice(const std::string & pinCode,int32_t osAccountId,std::string udid,int64_t requestId)27 int32_t HiChainAuthConnector::AuthDevice(const std::string &pinCode, int32_t osAccountId, std::string udid,
28     int64_t requestId)
29 {
30     return DmHiChainAuthConnector::dmHiChainAuthConnector->AuthDevice(pinCode, osAccountId, udid, requestId);
31 }
32 
ImportCredential(int32_t osAccountId,int32_t peerOsAccountId,std::string deviceId,std::string publicKey)33 int32_t HiChainAuthConnector::ImportCredential(int32_t osAccountId, int32_t peerOsAccountId, std::string deviceId,
34     std::string publicKey)
35 {
36     return DmHiChainAuthConnector::dmHiChainAuthConnector->ImportCredential(osAccountId, peerOsAccountId, deviceId,
37         publicKey);
38 }
39 
ProcessCredData(int64_t authReqId,const std::string & data)40 int32_t HiChainAuthConnector::ProcessCredData(int64_t authReqId, const std::string &data)
41 {
42     return DmHiChainAuthConnector::dmHiChainAuthConnector->ProcessCredData(authReqId, data);
43 }
44 
AddCredential(int32_t osAccountId,const std::string & authParams,std::string & creId)45 int32_t HiChainAuthConnector::AddCredential(int32_t osAccountId, const std::string &authParams, std::string &creId)
46 {
47     return DmHiChainAuthConnector::dmHiChainAuthConnector->AddCredential(osAccountId, authParams, creId);
48 }
49 
ExportCredential(int32_t osAccountId,const std::string & credId,std::string & publicKey)50 int32_t HiChainAuthConnector::ExportCredential(int32_t osAccountId, const std::string &credId, std::string &publicKey)
51 {
52     return DmHiChainAuthConnector::dmHiChainAuthConnector->ExportCredential(osAccountId, credId, publicKey);
53 }
54 
AgreeCredential(int32_t osAccountId,const std::string selfCredId,const std::string & authParams,std::string & credId)55 int32_t HiChainAuthConnector::AgreeCredential(int32_t osAccountId, const std::string selfCredId,
56     const std::string &authParams, std::string &credId)
57 {
58     return DmHiChainAuthConnector::dmHiChainAuthConnector->AgreeCredential(osAccountId, selfCredId, authParams, credId);
59 }
60 
DeleteCredential(int32_t osAccountId,const std::string & creId)61 int32_t HiChainAuthConnector::DeleteCredential(int32_t osAccountId, const std::string &creId)
62 {
63     return DmHiChainAuthConnector::dmHiChainAuthConnector->DeleteCredential(osAccountId, creId);
64 }
65 
AuthCredential(int32_t osAccountId,int64_t authReqId,const std::string & credId,const std::string & pinCode)66 int32_t HiChainAuthConnector::AuthCredential(int32_t osAccountId, int64_t authReqId, const std::string &credId,
67     const std::string &pinCode)
68 {
69     return DmHiChainAuthConnector::dmHiChainAuthConnector->AuthCredential(osAccountId, authReqId, credId, pinCode);
70 }
71 
AuthCredentialPinCode(int32_t osAccountId,int64_t authReqId,const std::string & pinCode)72 int32_t HiChainAuthConnector::AuthCredentialPinCode(int32_t osAccountId, int64_t authReqId, const std::string &pinCode)
73 {
74     return DmHiChainAuthConnector::dmHiChainAuthConnector->AuthCredentialPinCode(osAccountId, authReqId, pinCode);
75 }
76 
QueryCredentialInfo(int32_t userId,const JsonObject & queryParams,JsonObject & resultJson)77 int32_t HiChainAuthConnector::QueryCredentialInfo(int32_t userId, const JsonObject &queryParams, JsonObject &resultJson)
78 {
79     return DmHiChainAuthConnector::dmHiChainAuthConnector->QueryCredentialInfo(userId, queryParams, resultJson);
80 }
81 } // namespace DistributedHardware
82 } // namespace OHOS