1c5e268c6Sopenharmony_ci/*
2c5e268c6Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
3c5e268c6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4c5e268c6Sopenharmony_ci * you may not use this file except in compliance with the License.
5c5e268c6Sopenharmony_ci * You may obtain a copy of the License at
6c5e268c6Sopenharmony_ci *
7c5e268c6Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8c5e268c6Sopenharmony_ci *
9c5e268c6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10c5e268c6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11c5e268c6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12c5e268c6Sopenharmony_ci * See the License for the specific language governing permissions and
13c5e268c6Sopenharmony_ci * limitations under the License.
14c5e268c6Sopenharmony_ci */
15c5e268c6Sopenharmony_ci
16c5e268c6Sopenharmony_ci/**
17c5e268c6Sopenharmony_ci * @addtogroup HdfFingerprintAuth
18c5e268c6Sopenharmony_ci * @{
19c5e268c6Sopenharmony_ci *
20c5e268c6Sopenharmony_ci * @brief Provides APIs for the fingerprint auth driver.
21c5e268c6Sopenharmony_ci *
22c5e268c6Sopenharmony_ci * The fingerprint auth driver provides a unified interface for the fingerprint auth service to access the fingerprint auth driver.
23c5e268c6Sopenharmony_ci * After obtaining the fingerprint auth driver proxy, the service can call related APIs to obtain executors.
24c5e268c6Sopenharmony_ci * After obtaining the fingerprint auth executors, the service can call related APIs to get executor information, get
25c5e268c6Sopenharmony_ci * template information, and enroll, authenticate, and delete templates, etc.
26c5e268c6Sopenharmony_ci *
27c5e268c6Sopenharmony_ci * @since 5.0
28c5e268c6Sopenharmony_ci */
29c5e268c6Sopenharmony_ci
30c5e268c6Sopenharmony_ci/**
31c5e268c6Sopenharmony_ci * @file IAllInOneExecutor.idl
32c5e268c6Sopenharmony_ci *
33c5e268c6Sopenharmony_ci * @brief Defines the APIs of the executors. These APIs can be used to get executor information, get
34c5e268c6Sopenharmony_ci * template information, and enroll, authenticate, and delete templates, etc.
35c5e268c6Sopenharmony_ci *
36c5e268c6Sopenharmony_ci * @since 5.0
37c5e268c6Sopenharmony_ci */
38c5e268c6Sopenharmony_ci
39c5e268c6Sopenharmony_cipackage ohos.hdi.fingerprint_auth.v2_0;
40c5e268c6Sopenharmony_ci
41c5e268c6Sopenharmony_ciimport ohos.hdi.fingerprint_auth.v2_0.FingerprintAuthTypes;
42c5e268c6Sopenharmony_ciimport ohos.hdi.fingerprint_auth.v2_0.IExecutorCallback;
43c5e268c6Sopenharmony_ciimport ohos.hdi.fingerprint_auth.v2_0.ISaCommandCallback;
44c5e268c6Sopenharmony_ci
45c5e268c6Sopenharmony_ci/**
46c5e268c6Sopenharmony_ci * @brief Defines the APIs of the executors. These APIs can be used to get executor information, get
47c5e268c6Sopenharmony_ci * template information, and enroll, authenticate, and delete templates, etc.
48c5e268c6Sopenharmony_ci *
49c5e268c6Sopenharmony_ci * @since 5.0
50c5e268c6Sopenharmony_ci * @version 1.0
51c5e268c6Sopenharmony_ci */
52c5e268c6Sopenharmony_ciinterface IAllInOneExecutor {
53c5e268c6Sopenharmony_ci    /**
54c5e268c6Sopenharmony_ci     * @brief Gets executor information.
55c5e268c6Sopenharmony_ci     *
56c5e268c6Sopenharmony_ci     * @param executorInfo Indicates executor information. See {@link ExecutorInfo}.
57c5e268c6Sopenharmony_ci     *
58c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
59c5e268c6Sopenharmony_ci     * @return Returns a non-zero value if the operation fails.
60c5e268c6Sopenharmony_ci     */
61c5e268c6Sopenharmony_ci    GetExecutorInfo([out] struct ExecutorInfo executorInfo);
62c5e268c6Sopenharmony_ci    /**
63c5e268c6Sopenharmony_ci     * @brief Sends parameters to the driver when executor registration is finished.
64c5e268c6Sopenharmony_ci     *
65c5e268c6Sopenharmony_ci     * @param templateIdList Indicates the templates previously registered to the user auth framework.
66c5e268c6Sopenharmony_ci     * @param frameworkPublicKey Indicates the framework public key.
67c5e268c6Sopenharmony_ci     * @param extraInfo Indicates the extra information that is sent to the executors.
68c5e268c6Sopenharmony_ci     *
69c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
70c5e268c6Sopenharmony_ci     * @return Returns a non-zero value if the operation fails.
71c5e268c6Sopenharmony_ci     */
72c5e268c6Sopenharmony_ci    OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo);
73c5e268c6Sopenharmony_ci    /**
74c5e268c6Sopenharmony_ci     * @brief Cancels the enrollment, authentication, or identification operation.
75c5e268c6Sopenharmony_ci     *
76c5e268c6Sopenharmony_ci     * @param scheduleId Indicates the schedule ID of the operation to cancel.
77c5e268c6Sopenharmony_ci     *
78c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
79c5e268c6Sopenharmony_ci     * @return Returns a non-zero value if the operation fails.
80c5e268c6Sopenharmony_ci     */
81c5e268c6Sopenharmony_ci    Cancel([in] unsigned long scheduleId);
82c5e268c6Sopenharmony_ci    /**
83c5e268c6Sopenharmony_ci     * @brief Send message.
84c5e268c6Sopenharmony_ci     *
85c5e268c6Sopenharmony_ci     * @param scheduleId Indicates the schedule ID of the message.
86c5e268c6Sopenharmony_ci     * @param srcRole is the role of source.
87c5e268c6Sopenharmony_ci     * @param msg is the message content.
88c5e268c6Sopenharmony_ci     *
89c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
90c5e268c6Sopenharmony_ci     * @return Returns a non-zero value if the operation fails.
91c5e268c6Sopenharmony_ci     */
92c5e268c6Sopenharmony_ci    SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg);
93c5e268c6Sopenharmony_ci    /**
94c5e268c6Sopenharmony_ci     * @brief Enrolls templates.
95c5e268c6Sopenharmony_ci     *
96c5e268c6Sopenharmony_ci     * @param scheduleId Indicates the schedule ID of enrollment.
97c5e268c6Sopenharmony_ci     * @param extraInfo Indicates the extra information of enrollment.
98c5e268c6Sopenharmony_ci     * @param callbackObj Indicates the callback object of enrollment. See {@link IExecutorCallback}.
99c5e268c6Sopenharmony_ci     *
100c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
101c5e268c6Sopenharmony_ci     * @return Returns a non-zero value if the operation fails.
102c5e268c6Sopenharmony_ci     */
103c5e268c6Sopenharmony_ci    Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj);
104c5e268c6Sopenharmony_ci    /**
105c5e268c6Sopenharmony_ci     * @brief Authenticates templates.
106c5e268c6Sopenharmony_ci     *
107c5e268c6Sopenharmony_ci     * @param scheduleId Indicates the schedule ID of authentication.
108c5e268c6Sopenharmony_ci     * @param templateIdList Indicates the templates to authenticate.
109c5e268c6Sopenharmony_ci     * @param endAfterFirstFail Indicates end authentication after the first authentication failure.
110c5e268c6Sopenharmony_ci     * @param extraInfo Indicates the extra information of authentication.
111c5e268c6Sopenharmony_ci     * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}.
112c5e268c6Sopenharmony_ci     *
113c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
114c5e268c6Sopenharmony_ci     * @return Returns a non-zero value if the operation fails.
115c5e268c6Sopenharmony_ci     */
116c5e268c6Sopenharmony_ci    Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] boolean endAfterFirstFail,
117c5e268c6Sopenharmony_ci        [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj);
118c5e268c6Sopenharmony_ci    /**
119c5e268c6Sopenharmony_ci     * @brief Identifies templates.
120c5e268c6Sopenharmony_ci     *
121c5e268c6Sopenharmony_ci     * @param scheduleId Indicates the schedule ID of identification.
122c5e268c6Sopenharmony_ci     * @param extraInfo Indicates the extra information of identification.
123c5e268c6Sopenharmony_ci     * @param callbackObj Indicates the callback object of identification. See {@link IExecutorCallback}.
124c5e268c6Sopenharmony_ci     *
125c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
126c5e268c6Sopenharmony_ci     * @return Returns a non-zero value if the operation fails.
127c5e268c6Sopenharmony_ci     */
128c5e268c6Sopenharmony_ci    Identify([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj);
129c5e268c6Sopenharmony_ci    /**
130c5e268c6Sopenharmony_ci     * @brief Deletes templates.
131c5e268c6Sopenharmony_ci     *
132c5e268c6Sopenharmony_ci     * @param templateIdList Indicates the templates to delete.
133c5e268c6Sopenharmony_ci     *
134c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
135c5e268c6Sopenharmony_ci     * @return Returns a non-zero value if the operation fails.
136c5e268c6Sopenharmony_ci     */
137c5e268c6Sopenharmony_ci    Delete([in] unsigned long[] templateIdList);
138c5e268c6Sopenharmony_ci    /**
139c5e268c6Sopenharmony_ci     * @brief Sends a command to the driver.
140c5e268c6Sopenharmony_ci     *
141c5e268c6Sopenharmony_ci     * @param commandId Indicates the command ID. See {@link DriverCommandId}.
142c5e268c6Sopenharmony_ci     * @param extraInfo Indicates the extra information of the command.
143c5e268c6Sopenharmony_ci     * @param callbackObj Indicates the callback object of the command. See {@link IExecutorCallback}.
144c5e268c6Sopenharmony_ci     *
145c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
146c5e268c6Sopenharmony_ci     * @return Returns a non-zero value if the operation fails.
147c5e268c6Sopenharmony_ci     */
148c5e268c6Sopenharmony_ci    SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj);
149c5e268c6Sopenharmony_ci    /**
150c5e268c6Sopenharmony_ci     * @brief Get property.
151c5e268c6Sopenharmony_ci     *
152c5e268c6Sopenharmony_ci     * @param templateIdList Indicates the templates to process.
153c5e268c6Sopenharmony_ci     * @param propertyTypes Indicates the property types to get. See {@link GetPropertyType}.
154c5e268c6Sopenharmony_ci     * @param property Indicates property. See {@link Property}.
155c5e268c6Sopenharmony_ci     *
156c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
157c5e268c6Sopenharmony_ci     * @return Returns a non-zero value if the operation fails.
158c5e268c6Sopenharmony_ci     */
159c5e268c6Sopenharmony_ci    GetProperty([in] unsigned long[] templateIdList, [in] int[] propertyTypes, [out] struct Property property);
160c5e268c6Sopenharmony_ci    /**
161c5e268c6Sopenharmony_ci     * @brief Set cached templates.
162c5e268c6Sopenharmony_ci     *
163c5e268c6Sopenharmony_ci     * @param templateIdList Indicates the templates to cache.
164c5e268c6Sopenharmony_ci     *
165c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
166c5e268c6Sopenharmony_ci     * @return Returns a non-zero value if the operation fails.
167c5e268c6Sopenharmony_ci     */
168c5e268c6Sopenharmony_ci    SetCachedTemplates([in] unsigned long[] templateIdList);
169c5e268c6Sopenharmony_ci    /**
170c5e268c6Sopenharmony_ci     * @brief Register sa command callback.
171c5e268c6Sopenharmony_ci     *
172c5e268c6Sopenharmony_ci     * @param callbackObj Indicates the sa command callback.
173c5e268c6Sopenharmony_ci     *
174c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful.
175c5e268c6Sopenharmony_ci     * @return Returns a non-zero value if the operation fails.
176c5e268c6Sopenharmony_ci     */
177c5e268c6Sopenharmony_ci    RegisterSaCommandCallback([in] ISaCommandCallback callbackObj);
178c5e268c6Sopenharmony_ci}
179c5e268c6Sopenharmony_ci/** @} */