1c5e268c6Sopenharmony_ci/* 2c5e268c6Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 3c5e268c6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4c5e268c6Sopenharmony_ci * you may not use this file except in compliance with the License. 5c5e268c6Sopenharmony_ci * You may obtain a copy of the License at 6c5e268c6Sopenharmony_ci * 7c5e268c6Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8c5e268c6Sopenharmony_ci * 9c5e268c6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10c5e268c6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11c5e268c6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12c5e268c6Sopenharmony_ci * See the License for the specific language governing permissions and 13c5e268c6Sopenharmony_ci * limitations under the License. 14c5e268c6Sopenharmony_ci */ 15c5e268c6Sopenharmony_ci 16c5e268c6Sopenharmony_ci/** 17c5e268c6Sopenharmony_ci * @addtogroup HdfFaceAuth 18c5e268c6Sopenharmony_ci * @{ 19c5e268c6Sopenharmony_ci * 20c5e268c6Sopenharmony_ci * @brief Provides APIs for the face auth driver. 21c5e268c6Sopenharmony_ci * 22c5e268c6Sopenharmony_ci * The face auth driver provides a unified interface for the face auth service to access the face auth driver. 23c5e268c6Sopenharmony_ci * After obtaining the face auth driver proxy, the service can call related APIs to obtain executors. 24c5e268c6Sopenharmony_ci * After obtaining the face auth executors, the service can call related APIs to get executor information, get 25c5e268c6Sopenharmony_ci * template information, and enroll, authenticate, and delete templates, etc. 26c5e268c6Sopenharmony_ci * 27c5e268c6Sopenharmony_ci * @since 3.2 28c5e268c6Sopenharmony_ci */ 29c5e268c6Sopenharmony_ci 30c5e268c6Sopenharmony_ci/** 31c5e268c6Sopenharmony_ci * @file IExecutor.idl 32c5e268c6Sopenharmony_ci * 33c5e268c6Sopenharmony_ci * @brief Defines the APIs of the executors. These APIs can be used to get executor information, get 34c5e268c6Sopenharmony_ci * template information, and enroll, authenticate, and delete templates, etc. 35c5e268c6Sopenharmony_ci * 36c5e268c6Sopenharmony_ci * @since 3.2 37c5e268c6Sopenharmony_ci */ 38c5e268c6Sopenharmony_ci 39c5e268c6Sopenharmony_cipackage ohos.hdi.face_auth.v1_0; 40c5e268c6Sopenharmony_ci 41c5e268c6Sopenharmony_ciimport ohos.hdi.face_auth.v1_0.FaceAuthTypes; 42c5e268c6Sopenharmony_ciimport ohos.hdi.face_auth.v1_0.IExecutorCallback; 43c5e268c6Sopenharmony_cisequenceable ohos.hdi.camera.v1_0.BufferProducerSequenceable; 44c5e268c6Sopenharmony_ci 45c5e268c6Sopenharmony_ci/** 46c5e268c6Sopenharmony_ci * @brief Defines the APIs of the executors. These APIs can be used to get executor information, get 47c5e268c6Sopenharmony_ci * template information, and enroll, authenticate, and delete templates, etc. 48c5e268c6Sopenharmony_ci * 49c5e268c6Sopenharmony_ci * @since 3.2 50c5e268c6Sopenharmony_ci * @version 1.0 51c5e268c6Sopenharmony_ci */ 52c5e268c6Sopenharmony_ciinterface IExecutor { 53c5e268c6Sopenharmony_ci /** 54c5e268c6Sopenharmony_ci * @brief Gets executor information. 55c5e268c6Sopenharmony_ci * 56c5e268c6Sopenharmony_ci * @param executorInfo Indicates executor information. See {@link ExecutorInfo}. 57c5e268c6Sopenharmony_ci * 58c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 59c5e268c6Sopenharmony_ci * @return Returns a non-zero value if the operation fails. 60c5e268c6Sopenharmony_ci */ 61c5e268c6Sopenharmony_ci GetExecutorInfo([out] struct ExecutorInfo executorInfo); 62c5e268c6Sopenharmony_ci /** 63c5e268c6Sopenharmony_ci * @brief Gets template information. 64c5e268c6Sopenharmony_ci * 65c5e268c6Sopenharmony_ci * @param templateId Indicates the template ID. 66c5e268c6Sopenharmony_ci * @param templateInfo Indicates template information. See {@link TemplateInfo}. 67c5e268c6Sopenharmony_ci * 68c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 69c5e268c6Sopenharmony_ci * @return Returns a non-zero value if the operation fails. 70c5e268c6Sopenharmony_ci * 71c5e268c6Sopenharmony_ci * @deprecated 72c5e268c6Sopenharmony_ci */ 73c5e268c6Sopenharmony_ci GetTemplateInfo([in] unsigned long templateId, [out] struct TemplateInfo templateInfo); 74c5e268c6Sopenharmony_ci /** 75c5e268c6Sopenharmony_ci * @brief Sends parameters to the driver when executor registration is finished. 76c5e268c6Sopenharmony_ci * 77c5e268c6Sopenharmony_ci * @param templateIdList Indicates the templates previously registered to the user auth framework. 78c5e268c6Sopenharmony_ci * @param frameworkPublicKey Indicates the framework public key. 79c5e268c6Sopenharmony_ci * @param extraInfo Indicates the extra information that is sent to the executors. 80c5e268c6Sopenharmony_ci * 81c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 82c5e268c6Sopenharmony_ci * @return Returns a non-zero value if the operation fails. 83c5e268c6Sopenharmony_ci */ 84c5e268c6Sopenharmony_ci OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo); 85c5e268c6Sopenharmony_ci /** 86c5e268c6Sopenharmony_ci * @brief Enrolls templates. 87c5e268c6Sopenharmony_ci * 88c5e268c6Sopenharmony_ci * @param scheduleId Indicates the schedule ID of enrollment. 89c5e268c6Sopenharmony_ci * @param extraInfo Indicates the extra information of enrollment. 90c5e268c6Sopenharmony_ci * @param callbackObj Indicates the callback object of enrollment. See {@link IExecutorCallback}. 91c5e268c6Sopenharmony_ci * 92c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 93c5e268c6Sopenharmony_ci * @return Returns a non-zero value if the operation fails. 94c5e268c6Sopenharmony_ci */ 95c5e268c6Sopenharmony_ci Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 96c5e268c6Sopenharmony_ci /** 97c5e268c6Sopenharmony_ci * @brief Authenticates templates. 98c5e268c6Sopenharmony_ci * 99c5e268c6Sopenharmony_ci * @param scheduleId Indicates the schedule ID of authentication. 100c5e268c6Sopenharmony_ci * @param templateIdList Indicates the templates to authenticate. 101c5e268c6Sopenharmony_ci * @param extraInfo Indicates the extra information of authentication. 102c5e268c6Sopenharmony_ci * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}. 103c5e268c6Sopenharmony_ci * 104c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 105c5e268c6Sopenharmony_ci * @return Returns a non-zero value if the operation fails. 106c5e268c6Sopenharmony_ci */ 107c5e268c6Sopenharmony_ci Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 108c5e268c6Sopenharmony_ci /** 109c5e268c6Sopenharmony_ci * @brief Identifies templates. 110c5e268c6Sopenharmony_ci * 111c5e268c6Sopenharmony_ci * @param scheduleId Indicates the schedule ID of identification. 112c5e268c6Sopenharmony_ci * @param extraInfo Indicates the extra information of identification. 113c5e268c6Sopenharmony_ci * @param callbackObj Indicates the callback object of identification. See {@link IExecutorCallback}. 114c5e268c6Sopenharmony_ci * 115c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 116c5e268c6Sopenharmony_ci * @return Returns a non-zero value if the operation fails. 117c5e268c6Sopenharmony_ci */ 118c5e268c6Sopenharmony_ci Identify([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 119c5e268c6Sopenharmony_ci /** 120c5e268c6Sopenharmony_ci * @brief Deletes templates. 121c5e268c6Sopenharmony_ci * 122c5e268c6Sopenharmony_ci * @param templateIdList Indicates the templates to delete. 123c5e268c6Sopenharmony_ci * 124c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 125c5e268c6Sopenharmony_ci * @return Returns a non-zero value if the operation fails. 126c5e268c6Sopenharmony_ci */ 127c5e268c6Sopenharmony_ci Delete([in] unsigned long[] templateIdList); 128c5e268c6Sopenharmony_ci /** 129c5e268c6Sopenharmony_ci * @brief Cancels the enrollment, authentication, or identification operation. 130c5e268c6Sopenharmony_ci * 131c5e268c6Sopenharmony_ci * @param scheduleId Indicates the schedule ID of the operation to cancel. 132c5e268c6Sopenharmony_ci * 133c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 134c5e268c6Sopenharmony_ci * @return Returns a non-zero value if the operation fails. 135c5e268c6Sopenharmony_ci */ 136c5e268c6Sopenharmony_ci Cancel([in] unsigned long scheduleId); 137c5e268c6Sopenharmony_ci /** 138c5e268c6Sopenharmony_ci * @brief Sends a command to the driver. 139c5e268c6Sopenharmony_ci * 140c5e268c6Sopenharmony_ci * @param commandId Indicates the command ID. See {@link CommandId}. 141c5e268c6Sopenharmony_ci * @param extraInfo Indicates the extra information of the command. 142c5e268c6Sopenharmony_ci * @param callbackObj Indicates the callback object of the command. See {@link IExecutorCallback}. 143c5e268c6Sopenharmony_ci * 144c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 145c5e268c6Sopenharmony_ci * @return Returns a non-zero value if the operation fails. 146c5e268c6Sopenharmony_ci */ 147c5e268c6Sopenharmony_ci SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); 148c5e268c6Sopenharmony_ci /** 149c5e268c6Sopenharmony_ci * @brief Set buffer producer. 150c5e268c6Sopenharmony_ci * 151c5e268c6Sopenharmony_ci * @param bufferProducer Indicates bufferProducer set to executor. 152c5e268c6Sopenharmony_ci * 153c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 154c5e268c6Sopenharmony_ci * @return Returns a non-zero value if the operation fails. 155c5e268c6Sopenharmony_ci */ 156c5e268c6Sopenharmony_ci SetBufferProducer([in] BufferProducerSequenceable bufferProducer); 157c5e268c6Sopenharmony_ci} 158c5e268c6Sopenharmony_ci/** @} */