117fd14ceSopenharmony_ci/* 217fd14ceSopenharmony_ci * Copyright (C) 2023 Huawei Device Co., Ltd. 317fd14ceSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 417fd14ceSopenharmony_ci * you may not use this file except in compliance with the License. 517fd14ceSopenharmony_ci * You may obtain a copy of the License at 617fd14ceSopenharmony_ci * 717fd14ceSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 817fd14ceSopenharmony_ci * 917fd14ceSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1017fd14ceSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1117fd14ceSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1217fd14ceSopenharmony_ci * See the License for the specific language governing permissions and 1317fd14ceSopenharmony_ci * limitations under the License. 1417fd14ceSopenharmony_ci */ 1517fd14ceSopenharmony_ci 1617fd14ceSopenharmony_ci#ifndef AUTH_IDENTITY_COMMON_H 1717fd14ceSopenharmony_ci#define AUTH_IDENTITY_COMMON_H 1817fd14ceSopenharmony_ci 1917fd14ceSopenharmony_ci#include "data_manager.h" 2017fd14ceSopenharmony_ci#include "hc_vector.h" 2117fd14ceSopenharmony_ci#include "identity_defines.h" 2217fd14ceSopenharmony_ci#include "json_utils.h" 2317fd14ceSopenharmony_ci 2417fd14ceSopenharmony_ci#ifdef __cplusplus 2517fd14ceSopenharmony_ciextern "C" { 2617fd14ceSopenharmony_ci#endif 2717fd14ceSopenharmony_ci 2817fd14ceSopenharmony_ciint32_t ConvertPsk(const Uint8Buff *srcPsk, Uint8Buff *sharedSecret); 2917fd14ceSopenharmony_ciint32_t SetPreSharedUrlForProof(const char *urlStr, Uint8Buff *preSharedUrl); 3017fd14ceSopenharmony_ciCJson *CreateCredUrlJson(int32_t credentailType, int32_t keyType, int32_t trustType); 3117fd14ceSopenharmony_ci 3217fd14ceSopenharmony_ci#if 1 3317fd14ceSopenharmony_ciint32_t GetSelfDeviceEntry(int32_t osAccountId, const char *groupId, TrustedDeviceEntry *deviceEntry); 3417fd14ceSopenharmony_ciconst char *GetPeerDevIdFromJson(const CJson *in, bool *isUdid); 3517fd14ceSopenharmony_ciint32_t GetPeerDeviceEntry( 3617fd14ceSopenharmony_ci int32_t osAccountId, const CJson *in, const char *groupId, TrustedDeviceEntry *returnDeviceEntry); 3717fd14ceSopenharmony_ci 3817fd14ceSopenharmony_civoid FreeBuffData(Uint8Buff *buff); 3917fd14ceSopenharmony_ci 4017fd14ceSopenharmony_ciIdentityInfo *CreateIdentityInfo(void); 4117fd14ceSopenharmony_civoid DestroyIdentityInfo(IdentityInfo *info); 4217fd14ceSopenharmony_ci 4317fd14ceSopenharmony_ciIdentityInfoVec CreateIdentityInfoVec(void); 4417fd14ceSopenharmony_civoid ClearIdentityInfoVec(IdentityInfoVec *vec); 4517fd14ceSopenharmony_ci 4617fd14ceSopenharmony_ciProtocolEntityVec CreateProtocolEntityVec(void); 4717fd14ceSopenharmony_civoid ClearProtocolEntityVec(ProtocolEntityVec *vec); 4817fd14ceSopenharmony_ci#endif 4917fd14ceSopenharmony_ci 5017fd14ceSopenharmony_ci#ifdef __cplusplus 5117fd14ceSopenharmony_ci} 5217fd14ceSopenharmony_ci#endif 5317fd14ceSopenharmony_ci 5417fd14ceSopenharmony_ci#endif