• 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/**
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 info, get
25 * template info, enroll template, authenticate template, delete template, etc.
26 *
27 * @since 3.2
28 */
29
30/**
31 * @file IExecutor.idl
32 *
33 * @brief Defines the APIs of executor. These APIs can be used to get executor info, get
34 * template info, enroll template, authenticate template, delete template, etc.
35 *
36 * @since 3.2
37 */
38
39package ohos.hdi.pin_auth.v1_0;
40
41import ohos.hdi.pin_auth.v1_0.PinAuthTypes;
42import ohos.hdi.pin_auth.v1_0.IExecutorCallback;
43
44/**
45 * @brief Defines the APIs of executor. These APIs can be used to get executor info, get
46 * template info, enroll template, authenticate template, delete template, etc.
47 *
48 * @since 3.2
49 * @version 1.0
50 */
51
52interface IExecutor {
53    /**
54     * @brief Get executor info.
55     *
56     * @param executorInfo Indicates executor info, see {@link ExecutorInfo}.
57     *
58     * @return Returns <b>0</b> if the operation is successful.
59     * @return Returns a non-zero value if the operation fails.
60     */
61    GetExecutorInfo([out] struct ExecutorInfo executorInfo);
62    /**
63     * @brief Get template info.
64     *
65     * @param templateId Indicates template id.
66     * @param templateInfo Indicates template info, see {@link TemplateInfo}.
67     *
68     * @return Returns <b>0</b> if the operation is successful.
69     * @return Returns a non-zero value if the operation fails.
70     */
71    GetTemplateInfo([in] unsigned long templateId, [out] struct TemplateInfo templateInfo);
72    /**
73     * @brief Send parameters to driver when executor register finish.
74     *
75     * @param templateIdList Indicates templates previously registered to userauth framework.
76     * @param frameworkPublicKey Indicates framework public key.
77     * @param extraInfo Indicates extra info send to executor.
78     *
79     * @return Returns <b>0</b> if the operation is successful.
80     * @return Returns a non-zero value if the operation fails.
81     */
82    OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo);
83    /**
84     * @brief Set pin data to driver.
85     *
86     * @param scheduleId Indicates schedule id of the enrollment.
87     * @param authSubType Indicates the pin sub type.
88     * @param data Indicates the pin data.
89     *
90     * @return Returns <b>0</b> if the operation is successful.
91     * @return Returns a non-zero value if the operation fails.
92     */
93    OnSetData([in] unsigned long scheduleId, [in] unsigned long authSubType, [in] unsigned char[] data);
94    /**
95     * @brief Enroll template.
96     *
97     * @param scheduleId Indicates schedule id of enroll.
98     * @param extraInfo Indicates extra info of enroll.
99     * @param callbackObj Indicates enroll callback object, see {@link IExecutorCallback}.
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    Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj);
105    /**
106     * @brief Authenticate template.
107     *
108     * @param scheduleId Indicates schedule id of authenticate.
109     * @param templateId Indicates the template to authenticate.
110     * @param extraInfo Indicates extra info of authenticate.
111     * @param callbackObj Indicates authenticate callback object, see {@link IExecutorCallback}.
112     *
113     * @return Returns <b>0</b> if the operation is successful.
114     * @return Returns a non-zero value if the operation fails.
115     */
116    Authenticate([in] unsigned long scheduleId, [in] unsigned long templateId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj);
117    /**
118     * @brief Delete templates.
119     *
120     * @param templateId Indicates the template to delete.
121     *
122     * @return Returns <b>0</b> if the operation is successful.
123     * @return Returns a non-zero value if the operation fails.
124     */
125    Delete([in] unsigned long templateId);
126    /**
127     * @brief Cancel operation.
128     *
129     * @param scheduleId Indicates schedule id of operation to cancel.
130     *
131     * @return Returns <b>0</b> if the operation is successful.
132     * @return Returns a non-zero value if the operation fails.
133     */
134    Cancel([in] unsigned long scheduleId);
135    /**
136     * @brief Send command to driver.
137     *
138     * @param commandId Indicates command id. For details, see {@link CommandId}.
139     * @param extraInfo Indicates extra info of command.
140     * @param callbackObj Indicates command callback object, see {@link IExecutorCallback}.
141     *
142     * @return Returns <b>0</b> if the operation is successful.
143     * @return Returns a non-zero value if the operation fails.
144     */
145    SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj);
146}
147