• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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_COMMON_H
17 #define AUTH_COMMON_H
18 
19 #include "useridm_info.h"
20 #include "napi/native_api.h"
21 #include "napi/native_common.h"
22 #include "useridentity_manager.h"
23 
24 namespace OHOS {
25 namespace UserIAM {
26 namespace UserIDM {
27 class AuthCommon {
28 public:
29     static napi_value CreateObject(napi_env env, const std::string& keyStr, uint64_t credentialId);
30     static int32_t GetNamedProperty(napi_env env, napi_value obj, const std::string& keyStr);
31     static std::vector<uint8_t> GetNamedAttribute(napi_env env, napi_value obj);
32     static napi_status JudgeObjectType(napi_env env, napi_callback_info info,
33         AsyncCallbackContext* asyncCallbackContext);
34     static std::vector<uint8_t> JudgeArryType(napi_env env, size_t argc, napi_value* argv);
35     static void JudgeDelUserType(napi_env env, napi_callback_info info, AsyncCallbackContext* asyncCallbackContext);
36     static void JudgeDelCredType(napi_env env, napi_callback_info info, AsyncCallbackContext* asyncCallbackContext);
37     static void SaveCallback(napi_env env, size_t argc, napi_value* argv, AsyncCallbackContext* asyncCallbackContext);
38 };
39 } // namespace UserIDM
40 } // namespace UserIAM
41 } // namespace OHOS
42 #endif  // AUTH_COMMON_H
43