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 HdfFingerprintAuth 18 * @{ 19 * 20 * @brief Provides APIs for the fingerprint auth driver. 21 * 22 * The fingerprint auth driver provides a unified interface for the fingerprint auth service to access the fingerprint auth driver. 23 * After obtaining the fingerprint auth driver proxy, the service can call related APIs to obtain executors. 24 * After obtaining the fingerprint 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.fingerprint_auth.v1_0; 40 41import ohos.hdi.fingerprint_auth.v1_0.FingerprintAuthTypes; 42import ohos.hdi.fingerprint_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 */ 51interface IExecutor { 52 /** 53 * @brief Get executor info. 54 * 55 * @param executorInfo Indicates executor info, see {@link ExecutorInfo}. 56 * 57 * @return Returns <b>0</b> if the operation is successful. 58 * @return Returns a non-zero value if the operation fails. 59 */ 60 GetExecutorInfo([out] struct ExecutorInfo executorInfo); 61 /** 62 * @brief Get template info. 63 * 64 * @param templateId Indicates template id. 65 * @param templateInfo Indicates template info, see {@link TemplateInfo}. 66 * 67 * @return Returns <b>0</b> if the operation is successful. 68 * @return Returns a non-zero value if the operation fails. 69 * 70 * @deprecated 71 */ 72 GetTemplateInfo([in] unsigned long templateId, [out] struct TemplateInfo templateInfo); 73 /** 74 * @brief Send parameters to driver when executor register finish. 75 * 76 * @param templateIdList Indicates templates previously registered to userauth framework. 77 * @param frameworkPublicKey Indicates framework public key. 78 * @param extraInfo Indicates extra info send to executor. 79 * 80 * @return Returns <b>0</b> if the operation is successful. 81 * @return Returns a non-zero value if the operation fails. 82 */ 83 OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo); 84 /** 85 * @brief Enroll template. 86 * 87 * @param scheduleId Indicates schedule id of enroll. 88 * @param extraInfo Indicates extra info of enroll. 89 * @param callbackObj Indicates enroll callback object, see {@link IExecutorCallback}. 90 * 91 * @return Returns <b>0</b> if the operation is successful. 92 * @return Returns a non-zero value if the operation fails. 93 */ 94 Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 95 /** 96 * @brief Authenticate template. 97 * 98 * @param scheduleId Indicates schedule id of authenticate. 99 * @param templateIdList Indicates the templates to authenticate. 100 * @param extraInfo Indicates extra info of authenticate. 101 * @param callbackObj Indicates authenticate callback object, see {@link IExecutorCallback}. 102 * 103 * @return Returns <b>0</b> if the operation is successful. 104 * @return Returns a non-zero value if the operation fails. 105 * 106 * @deprecated 107 */ 108 Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 109 /** 110 * @brief Identify template. 111 * 112 * @param scheduleId Indicates schedule id of identify. 113 * @param extraInfo Indicates extra info of identify. 114 * @param callbackObj Indicates identify callback object, see {@link IExecutorCallback}. 115 * 116 * @return Returns <b>0</b> if the operation is successful. 117 * @return Returns a non-zero value if the operation fails. 118 */ 119 Identify([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 120 /** 121 * @brief Delete templates. 122 * 123 * @param templateIdList Indicates the templates to delete. 124 * 125 * @return Returns <b>0</b> if the operation is successful. 126 * @return Returns a non-zero value if the operation fails. 127 */ 128 Delete([in] unsigned long[] templateIdList); 129 /** 130 * @brief Cancel enroll, authenticate or identify operation. 131 * 132 * @param scheduleId Indicates schedule id of operation to cancel. 133 * 134 * @return Returns <b>0</b> if the operation is successful. 135 * @return Returns a non-zero value if the operation fails. 136 */ 137 Cancel([in] unsigned long scheduleId); 138 /** 139 * @brief Send command to driver. 140 * 141 * @param commandId Indicates command id. For details, see {@link CommandId}. 142 * @param extraInfo Indicates extra info of command. 143 * @param callbackObj Indicates command callback object, see {@link IExecutorCallback}. 144 * 145 * @return Returns <b>0</b> if the operation is successful. 146 * @return Returns a non-zero value if the operation fails. 147 */ 148 SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 149}