1/* 2 * Copyright (c) 2024 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 HdfFaceAuth 18 * @{ 19 * 20 * @brief Provides APIs for the face auth driver. 21 * 22 * The face auth driver provides a unified interface for the face auth service to access the face auth driver. 23 * After obtaining the face auth driver proxy, the service can call related APIs to obtain executors. 24 * After obtaining the face 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 */ 29 30/** 31 * @file IAllInOneExecutor.idl 32 * 33 * @brief Defines the APIs of the executors. These APIs can be used to get executor information, get 34 * template information, and enroll, authenticate, and delete templates, etc. 35 * 36 * @since 5.0 37 */ 38 39package ohos.hdi.face_auth.v2_0; 40 41import ohos.hdi.face_auth.v2_0.FaceAuthTypes; 42import ohos.hdi.face_auth.v2_0.IExecutorCallback; 43import ohos.hdi.face_auth.v2_0.ISaCommandCallback; 44 45/** 46 * @brief Defines the APIs of the executors. These APIs can be used to get executor information, get 47 * template information, and enroll, authenticate, and delete templates, etc. 48 * 49 * @since 5.0 50 * @version 1.0 51 */ 52interface IAllInOneExecutor { 53 /** 54 * @brief Gets executor information. 55 * 56 * @param executorInfo Indicates executor information. 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 Sends parameters to the driver when executor registration is finished. 64 * 65 * @param templateIdList Indicates the templates previously registered to the user auth framework. 66 * @param frameworkPublicKey Indicates the framework public key. 67 * @param extraInfo Indicates the extra information that is sent to the executors. 68 * 69 * @return Returns <b>0</b> if the operation is successful. 70 * @return Returns a non-zero value if the operation fails. 71 */ 72 OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo); 73 /** 74 * @brief Cancels the enrollment, authentication, or identification operation. 75 * 76 * @param scheduleId Indicates the schedule ID of the operation to cancel. 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 Cancel([in] unsigned long scheduleId); 82 /** 83 * @brief Send message. 84 * 85 * @param scheduleId Indicates the schedule ID of the message. 86 * @param srcRole is the role of source. 87 * @param msg is the message content. 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 SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg); 93 /** 94 * @brief Enrolls templates. 95 * 96 * @param scheduleId Indicates the schedule ID of enrollment. 97 * @param extraInfo Indicates the extra information of enrollment. 98 * @param callbackObj Indicates the callback object of enrollment. See {@link IExecutorCallback}. 99 * 100 * @return Returns <b>0</b> if the operation is successful. 101 * @return Returns a non-zero value if the operation fails. 102 */ 103 Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 104 /** 105 * @brief Authenticates templates. 106 * 107 * @param scheduleId Indicates the schedule ID of authentication. 108 * @param templateIdList Indicates the templates to authenticate. 109 * @param extraInfo Indicates the extra information of authentication. 110 * @param callbackObj Indicates the callback object of authentication. 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 Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 116 /** 117 * @brief Identifies templates. 118 * 119 * @param scheduleId Indicates the schedule ID of identification. 120 * @param extraInfo Indicates the extra information of identification. 121 * @param callbackObj Indicates the callback object of identification. See {@link IExecutorCallback}. 122 * 123 * @return Returns <b>0</b> if the operation is successful. 124 * @return Returns a non-zero value if the operation fails. 125 */ 126 Identify([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 127 /** 128 * @brief Deletes templates. 129 * 130 * @param templateIdList Indicates the templates to delete. 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 Delete([in] unsigned long[] templateIdList); 136 /** 137 * @brief Sends a command to the driver. 138 * 139 * @param commandId Indicates the command ID. See {@link DriverCommandId}. 140 * @param extraInfo Indicates the extra information of the command. 141 * @param callbackObj Indicates the callback object of the command. See {@link IExecutorCallback}. 142 * 143 * @return Returns <b>0</b> if the operation is successful. 144 * @return Returns a non-zero value if the operation fails. 145 */ 146 SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 147 /** 148 * @brief Get property. 149 * 150 * @param templateIdList Indicates the templates to process. 151 * @param propertyTypes Indicates the property types to get. See {@link GetPropertyType}. 152 * @param property Indicates property. See {@link Property}. 153 * 154 * @return Returns <b>0</b> if the operation is successful. 155 * @return Returns a non-zero value if the operation fails. 156 */ 157 GetProperty([in] unsigned long[] templateIdList, [in] int[] propertyTypes, [out] struct Property property); 158 /** 159 * @brief Set cached templates. 160 * 161 * @param templateIdList Indicates the templates to cache. 162 * 163 * @return Returns <b>0</b> if the operation is successful. 164 * @return Returns a non-zero value if the operation fails. 165 */ 166 SetCachedTemplates([in] unsigned long[] templateIdList); 167 /** 168 * @brief Register sa command callback. 169 * 170 * @param callbackObj Indicates the sa command callback. 171 * 172 * @return Returns <b>0</b> if the operation is successful. 173 * @return Returns a non-zero value if the operation fails. 174 */ 175 RegisterSaCommandCallback([in] ISaCommandCallback callbackObj); 176} 177/** @} */