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 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 information, get 25 * template information, and enroll, authenticate, and delete templates, etc. 26 * 27 * @since 5.0 28 * @version 1.0 29 */ 30 31/** 32 * @file ICollector.idl 33 * 34 * @brief Defines the APIs of the collectors. These APIs can be used to get executor information, 35 * cancel, collect data, and send message, etc. 36 * 37 * @since 5.0 38 * @version 1.0 39 */ 40 41package ohos.hdi.pin_auth.v2_1; 42 43import ohos.hdi.pin_auth.v2_1.PinAuthTypes; 44import ohos.hdi.pin_auth.v2_1.IExecutorCallback; 45 46/** 47 * @brief Defines the APIs of the collectors. These APIs can be used to get executor information, 48 * cancel, collect data, and send message, etc. 49 * 50 * @since 5.0 51 * @version 1.0 52 */ 53 54interface ICollector { 55 /** 56 * @brief Gets executor information. 57 * 58 * @param executorInfo Indicates executor information. See {@link ExecutorInfo}. 59 * 60 * @return Returns <b>0</b> if the operation is successful. 61 * @return Returns a non-zero value if the operation fails. 62 * 63 * @since 5.0 64 * @version 1.0 65 */ 66 GetExecutorInfo([out] struct ExecutorInfo executorInfo); 67 /** 68 * @brief Sends parameters to the driver when executor registration is finished. 69 * 70 * @param templateIdList Indicates the templates previously registered to the user auth framework. 71 * @param frameworkPublicKey Indicates the framework public key. 72 * @param extraInfo Indicates the extra information that is sent to the executors. 73 * 74 * @return Returns <b>0</b> if the operation is successful. 75 * @return Returns a non-zero value if the operation fails. 76 */ 77 OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo); 78 /** 79 * @brief Cancels an operation. 80 * 81 * @param scheduleId Indicates the schedule ID of the operation to cancel. 82 * 83 * @return Returns <b>0</b> if the operation is successful. 84 * @return Returns a non-zero value if the operation fails. 85 * 86 * @since 5.0 87 * @version 1.0 88 */ 89 Cancel([in] unsigned long scheduleId); 90 /** 91 * @brief Send message. 92 * 93 * @param scheduleId Indicates the schedule ID of the message. 94 * @param srcRole is the role of source. 95 * @param msg is the message content. 96 * 97 * @return Returns <b>0</b> if the operation is successful. 98 * @return Returns a non-zero value if the operation fails. 99 * 100 * @since 5.0 101 * @version 1.0 102 */ 103 SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg); 104 /** 105 * @brief Sets pin data. 106 * 107 * @param scheduleId Indicates the schedule ID of enrollment. 108 * @param authSubType Indicates the pin sub type. 109 * @param data Indicates the pin data. 110 * @param resultCode Indicates the result code. 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 * @since 5.0 116 * @version 1.0 117 */ 118 SetData([in] unsigned long scheduleId, [in] unsigned long authSubType, [in] unsigned char[] data, 119 [in] int resultCode); 120 /** 121 * @brief Collect template data. 122 * 123 * @param scheduleId Indicates the schedule ID of collection. 124 * @param extraInfo Indicates the extra information of collection. 125 * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}. 126 * 127 * @return Returns <b>0</b> if the operation is successful. 128 * @return Returns a non-zero value if the operation fails. 129 * 130 * @since 5.0 131 * @version 1.0 132 */ 133 Collect([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, 134 [in] IExecutorCallback callbackObj); 135} 136/** @} */