• 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 #ifndef AUTH_HICHAIN_ADAPTER_H
17 #define AUTH_HICHAIN_ADAPTER_H
18 
19 #include "device_auth.h"
20 #include <stdbool.h>
21 #include <stdint.h>
22 
23 #include "auth_hichain.h"
24 #include "auth_hichain_adapter_struct.h"
25 
26 #ifdef __cplusplus
27 #if __cplusplus
28 extern "C" {
29 #endif
30 #endif
31 
32 int32_t RegChangeListener(const char *appId, DataChangeListener *listener);
33 int32_t UnregChangeListener(const char *appId);
34 int32_t AuthDevice(int32_t userId, int64_t authReqId, const char *authParams, const DeviceAuthCallback *cb);
35 int32_t ProcessAuthData(int64_t authSeq, const uint8_t *data, uint32_t len, DeviceAuthCallback *cb);
36 bool CheckDeviceInGroupByType(const char *udid, const char *uuid, HichainGroup groupType);
37 bool CheckHasRelatedGroupInfo(HichainGroup groupType);
38 void DestroyDeviceAuth(void);
39 bool IsPotentialTrustedDevice(TrustedRelationIdType idType, const char *deviceId, bool isPrecise, bool isPointToPoint);
40 bool IsSameAccountGroupDevice(void);
41 void CancelRequest(int64_t authReqId, const char *appId);
42 char *GenDeviceLevelParam(HiChainAuthParam *hiChainParam);
43 
44 #ifdef __cplusplus
45 #if __cplusplus
46 }
47 #endif
48 #endif
49 #endif /* AUTH_HICHAIN_ADAPTER_H */