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 GetTemplateInfo([in] unsigned long templateId, [out] struct TemplateInfo templateInfo); 71 /** 72 * @brief Send parameters to driver when executor register finish. 73 * 74 * @param templateIdList Indicates templates previously registered to userauth framework. 75 * @param frameworkPublicKey Indicates framework public key. 76 * @param extraInfo Indicates extra info send to executor. 77 * 78 * @return Returns <b>0</b> if the operation is successful. 79 * @return Returns a non-zero value if the operation fails. 80 */ 81 OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo); 82 /** 83 * @brief Enroll template. 84 * 85 * @param scheduleId Indicates schedule id of enroll. 86 * @param extraInfo Indicates extra info of enroll. 87 * @param callbackObj Indicates enroll callback object, see {@link IExecutorCallback}. 88 * 89 * @return Returns <b>0</b> if the operation is successful. 90 * @return Returns a non-zero value if the operation fails. 91 */ 92 Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 93 /** 94 * @brief Authenticate template. 95 * 96 * @param scheduleId Indicates schedule id of authenticate. 97 * @param templateIdList Indicates the templates to authenticate. 98 * @param extraInfo Indicates extra info of authenticate. 99 * @param callbackObj Indicates authenticate 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 Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 105 /** 106 * @brief Identify template. 107 * 108 * @param scheduleId Indicates schedule id of identify. 109 * @param extraInfo Indicates extra info of identify. 110 * @param callbackObj Indicates identify callback object, see {@link IExecutorCallback}. 111 * 112 * @return Returns <b>0</b> if the operation is successful. 113 * @return Returns a non-zero value if the operation fails. 114 */ 115 Identify([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 116 /** 117 * @brief Delete templates. 118 * 119 * @param templateIdList Indicates the templates to delete. 120 * 121 * @return Returns <b>0</b> if the operation is successful. 122 * @return Returns a non-zero value if the operation fails. 123 */ 124 Delete([in] unsigned long[] templateIdList); 125 /** 126 * @brief Cancel enroll, authenticate or identify operation. 127 * 128 * @param scheduleId Indicates schedule id of operation to cancel. 129 * 130 * @return Returns <b>0</b> if the operation is successful. 131 * @return Returns a non-zero value if the operation fails. 132 */ 133 Cancel([in] unsigned long scheduleId); 134 /** 135 * @brief Send command to driver. 136 * 137 * @param commandId Indicates command id. For details, see {@link CommandId}. 138 * @param extraInfo Indicates extra info of command. 139 * @param callbackObj Indicates command callback object, see {@link IExecutorCallback}. 140 * 141 * @return Returns <b>0</b> if the operation is successful. 142 * @return Returns a non-zero value if the operation fails. 143 */ 144 SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 145}