• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-2024 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 PIN_AUTH_DRIVER_HDI
17 #define PIN_AUTH_DRIVER_HDI
18 
19 #include <mutex>
20 #include <vector>
21 
22 #include "nocopyable.h"
23 
24 #include "iam_executor_iauth_driver_hdi.h"
25 #include "iremote_broker.h"
26 #include "iam_executor_iauth_executor_hdi.h"
27 #include "pin_auth_interface_adapter.h"
28 #include "pin_auth_hdi.h"
29 
30 namespace OHOS {
31 namespace UserIam {
32 namespace PinAuth {
33 class PinAuthDriverHdi : public UserAuth::IAuthDriverHdi, public NoCopyable {
34 public:
35     explicit PinAuthDriverHdi(const std::shared_ptr<PinAuthInterfaceAdapter> &pinAuthInterfaceAdapter);
36     ~PinAuthDriverHdi() override = default;
37     void GetExecutorList(std::vector<std::shared_ptr<UserAuth::IAuthExecutorHdi>> &executorList) override;
38     void OnHdiDisconnect() override;
39     void OnFrameworkDown() override;
40 
41 private:
42     void GetAllInOneExecutorList(std::vector<std::shared_ptr<UserAuth::IAuthExecutorHdi>> &executorList,
43         std::vector<sptr<IAllInOneExecutor>> &iExecutorList);
44     void GetCollectorExecutorList(std::vector<std::shared_ptr<UserAuth::IAuthExecutorHdi>> &executorList,
45         std::vector<sptr<ICollector>> &iCollectorList);
46     void GetVerifierExecutorList(std::vector<std::shared_ptr<UserAuth::IAuthExecutorHdi>> &executorList,
47         std::vector<sptr<IVerifier>> &iVerifierList);
48 
49     const std::shared_ptr<PinAuthInterfaceAdapter> pinAuthInterfaceAdapter_;
50 };
51 } // PinAuth
52 } // UserIam
53 } // OHOS
54 
55 #endif // PIN_AUTH_DRIVER_HDI