• 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 IAUTH_EXECUTOR_HDI_H
17 #define IAUTH_EXECUTOR_HDI_H
18 
19 #include <cstdint>
20 #include <vector>
21 
22 #include "co_auth_client.h"
23 #include "framework_types.h"
24 #include "iam_common_defines.h"
25 #include "iexecute_callback.h"
26 
27 namespace OHOS {
28 namespace UserIam {
29 namespace UserAuth {
30 class IAuthExecutorHdi {
31 public:
32     IAuthExecutorHdi() = default;
33     virtual ~IAuthExecutorHdi() = default;
34 
35     virtual ResultCode GetExecutorInfo(ExecutorInfo &info) = 0;
36     virtual ResultCode GetTemplateInfo(uint64_t templateId, UserAuth::TemplateInfo &info) = 0;
37     virtual ResultCode OnRegisterFinish(const std::vector<uint64_t> &templateIdList,
38         const std::vector<uint8_t> &frameworkPublicKey, const std::vector<uint8_t> &extraInfo) = 0;
39     virtual ResultCode Enroll(uint64_t scheduleId, uint32_t tokenId, const std::vector<uint8_t> &extraInfo,
40         const std::shared_ptr<UserAuth::IExecuteCallback> &callbackObj) = 0;
41     virtual ResultCode Authenticate(uint64_t scheduleId, uint32_t tokenId, const std::vector<uint64_t> &templateIdList,
42         const std::vector<uint8_t> &extraInfo, const std::shared_ptr<UserAuth::IExecuteCallback> &callbackObj) = 0;
43     virtual ResultCode Identify(uint64_t scheduleId, uint32_t tokenId, const std::vector<uint8_t> &extraInfo,
44 
45         const std::shared_ptr<UserAuth::IExecuteCallback> &callbackObj) = 0;
46     virtual ResultCode Delete(const std::vector<uint64_t> &templateIdList) = 0;
47     virtual ResultCode Cancel(uint64_t scheduleId) = 0;
48     virtual ResultCode SendCommand(PropertyMode commandId, const std::vector<uint8_t> &extraInfo,
49         const std::shared_ptr<UserAuth::IExecuteCallback> &callbackObj) = 0;
50 };
51 } // namespace UserAuth
52 } // namespace UserIam
53 } // namespace OHOS
54 
55 #endif // IAUTH_EXECUTOR_HDI_H