1 /*
2  * Copyright (c) 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_VERIFIER_HDI_H
17 #define PIN_AUTH_VERIFIER_HDI_H
18 
19 #include <cstdint>
20 #include <map>
21 #include <vector>
22 
23 #include "iam_executor_framework_types.h"
24 #include "iam_executor_iauth_executor_hdi.h"
25 #include "iam_executor_iexecute_callback.h"
26 #include "nocopyable.h"
27 #include "pin_auth_hdi.h"
28 
29 namespace OHOS {
30 namespace UserIam {
31 namespace PinAuth {
32 class PinAuthVerifierHdi : public UserAuth::IAuthExecutorHdi, public NoCopyable {
33 public:
34     explicit PinAuthVerifierHdi(const sptr<IVerifier> &verifierProxy);
35     ~PinAuthVerifierHdi() override = default;
36 
37     UserAuth::ResultCode GetExecutorInfo(UserAuth::ExecutorInfo &info) override;
38     UserAuth::ResultCode OnRegisterFinish(const std::vector<uint64_t> &templateIdList,
39         const std::vector<uint8_t> &frameworkPublicKey, const std::vector<uint8_t> &extraInfo) override;
40     UserAuth::ResultCode Cancel(uint64_t scheduleId) override;
41     UserAuth::ResultCode SendMessage(uint64_t scheduleId, int32_t srcRole, const std::vector<uint8_t> &msg) override;
42     UserAuth::ResultCode Authenticate(uint64_t scheduleId, const UserAuth::AuthenticateParam &param,
43         const std::shared_ptr<UserAuth::IExecuteCallback> &callbackObj) override;
44     UserAuth::ResultCode NotifyCollectorReady(uint64_t scheduleId) override;
45 
46 private:
47     sptr<IVerifier> verifierProxy_ {nullptr};
48 };
49 } // namespace PinAuth
50 } // namespace UserIam
51 } // namespace OHOS
52 
53 #endif // PIN_AUTH_VERIFIER_HDI_H