• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 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/**
17 * @addtogroup HdfPinAuth
18 * @{
19 *
20 * @brief Provides APIs for the pin auth driver.
21 *
22 * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver.
23 * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors.
24 * After obtaining the pin auth executors, the service can call related APIs to get executor information, get
25 * template information, and enroll, authenticate, and delete templates, etc.
26 *
27 * @since 5.0
28 * @version 1.1
29 */
30
31/**
32 * @file IAllInOneExecutor.idl
33 *
34 * @brief Defines the APIs of the all-in-one executors. These APIs can be used to get executor information, get property,
35 * enroll, authenticate, and delete templates, etc.
36 *
37 * @since 5.0
38 * @version 1.1
39 */
40
41package ohos.hdi.pin_auth.v3_0;
42
43import ohos.hdi.pin_auth.v3_0.PinAuthTypes;
44import ohos.hdi.pin_auth.v3_0.IExecutorCallback;
45
46/**
47 * @brief Defines the APIs of the all-in-one executors. These APIs can be used to get executor information, get property,
48 * enroll, authenticate, and delete templates, etc.
49 *
50 * @since 5.0
51 * @version 1.1
52 */
53
54interface IAllInOneExecutor {
55    /**
56     * @brief Gets executor information.
57     *
58     * @param executorInfo Indicates executor information. See {@link ExecutorInfo}.
59     *
60     * @return Returns <b>0</b> if the operation is successful.
61     * @return Returns a non-zero value if the operation fails.
62     *
63     * @since 5.0
64     * @version 1.0
65     */
66    GetExecutorInfo([out] struct ExecutorInfo executorInfo);
67    /**
68     * @brief Sends parameters to the driver when executor registration is finished.
69     *
70     * @param templateIdList Indicates the templates previously registered to the user auth framework.
71     * @param frameworkPublicKey Indicates the framework public key.
72     * @param extraInfo Indicates the extra information that is sent to the executors.
73     *
74     * @return Returns <b>0</b> if the operation is successful.
75     * @return Returns a non-zero value if the operation fails.
76     *
77     * @since 5.0
78     * @version 1.0
79     */
80    OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey,
81        [in] unsigned char[] extraInfo);
82    /**
83     * @brief Cancels an operation.
84     *
85     * @param scheduleId Indicates the schedule ID of the operation to cancel.
86     *
87     * @return Returns <b>0</b> if the operation is successful.
88     * @return Returns a non-zero value if the operation fails.
89     *
90     * @since 5.0
91     * @version 1.0
92     */
93    Cancel([in] unsigned long scheduleId);
94    /**
95     * @brief Send message.
96     *
97     * @param scheduleId Indicates the schedule ID of the message.
98     * @param srcRole is the role of source.
99     * @param msg is the message content.
100     *
101     * @return Returns <b>0</b> if the operation is successful.
102     * @return Returns a non-zero value if the operation fails.
103     *
104     * @since 5.0
105     * @version 1.0
106     */
107    SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg);
108    /**
109     * @brief Sets pin data.
110     *
111     * @param scheduleId Indicates the schedule ID of enrollment.
112     * @param authSubType Indicates the pin sub type.
113     * @param data Indicates the pin data.
114     * @param data Indicates the pin length.
115     * @param resultCode Indicates the result code.
116     *
117     * @return Returns <b>0</b> if the operation is successful.
118     * @return Returns a non-zero value if the operation fails.
119     *
120     * @since 5.0
121     * @version 2.0
122     */
123    SetData([in] unsigned long scheduleId, [in] unsigned long authSubType, [in] unsigned char[] data,
124        [in] unsigned int pinLength, [in] int resultCode);
125    /**
126     * @brief Enrolls templates.
127     *
128     * @param scheduleId Indicates the schedule ID of enrollment.
129     * @param extraInfo Indicates the extra information of enrollment.
130     * @param callbackObj Indicates the callback object of enrollment. See {@link IExecutorCallback}.
131     *
132     * @return Returns <b>0</b> if the operation is successful.
133     * @return Returns a non-zero value if the operation fails.
134     *
135     * @since 5.0
136     * @version 1.0
137     */
138    Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj);
139    /**
140     * @brief Authenticates templates.
141     *
142     * @param scheduleId Indicates the schedule ID of authentication.
143     * @param templateIdList Indicates the templates to authenticate.
144     * @param extraInfo Indicates the extra information of authentication.
145     * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}.
146     *
147     * @return Returns <b>0</b> if the operation is successful.
148     * @return Returns a non-zero value if the operation fails.
149     *
150     * @since 5.0
151     * @version 1.0
152     */
153    Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo,
154        [in] IExecutorCallback callbackObj);
155    /**
156     * @brief Deletes templates.
157     *
158     * @param templateId Indicates the templates to delete.
159     *
160     * @return Returns <b>0</b> if the operation is successful.
161     * @return Returns a non-zero value if the operation fails.
162     *
163     * @since 5.0
164     * @version 1.0
165     */
166    Delete([in] unsigned long templateId);
167    /**
168     * @brief Get property.
169     *
170     * @param templateIdList Indicates the templates to process.
171     * @param propertyTypes Indicates the property types to get. See {@link GetPropertyType}.
172     * @param property Indicates property. See {@link Property}.
173     *
174     * @return Returns <b>0</b> if the operation is successful.
175     * @return Returns a non-zero value if the operation fails.
176     *
177     * @since 5.0
178     * @version 1.0
179     */
180    GetProperty([in] unsigned long[] templateIdList, [in] int[] propertyTypes, [out] struct Property property);
181    /**
182     * @brief Sends a command to the driver.
183     *
184     * @param commandId Indicates the command ID. See {@link CommandId}.
185     * @param extraInfo Indicates the extra information of the command.
186     * @param callbackObj Indicates the callback object of the command. See {@link IExecutorCallback}.
187     *
188     * @return Returns <b>0</b> if the operation is successful.
189     * @return Returns a non-zero value if the operation fails.
190     *
191     * @since 5.0
192     * @version 1.0
193     */
194    SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj);
195    /**
196     * @brief Abandon tempalte.
197     *
198     * @param scheduleId Indicates the schedule ID of abandon.
199     * @param templateId Indicates the template to abandon.
200     * @param extraInfo Indicates the extra information of abandon.
201     * @param callbackObj Indicates the callback object of abandon. See {@link IExecutorCallback}.
202     *
203     * @return Returns <b>0</b> if the operation is successful.
204     * @return Returns a non-zero value if the operation fails.
205     *
206     * @since 6.0
207     * @version 1.0
208     */
209    Abandon([in] unsigned long scheduleId, [in] unsigned long templateId, [in] unsigned char[] extraInfo,
210        [in] IExecutorCallback callbackObj);
211}
212
213/** @} */