diff --git a/pin_auth/bundle.json b/pin_auth/bundle.json index bfb9cb4ceea35e4c7bdd1ec96a0e17b108ba7d1d..11eefe28f975826304e76a6d4da92a35a65ff77a 100644 --- a/pin_auth/bundle.json +++ b/pin_auth/bundle.json @@ -35,14 +35,14 @@ }, "build":{ "sub_component":[ - "//drivers/interface/pin_auth/v2_1:pin_auth_idl_target" + "//drivers/interface/pin_auth/v2_2:pin_auth_idl_target" ], "test":[ ], "inner_kits":[ { - "name":"//drivers/interface/pin_auth/v2_1:libpin_auth_proxy_2.1", + "name":"//drivers/interface/pin_auth/v2_2:libpin_auth_proxy_2.2", "header":{ "header_files":[ @@ -51,7 +51,7 @@ } }, { - "name":"//drivers/interface/pin_auth/v2_1:libpin_auth_stub_2.1", + "name":"//drivers/interface/pin_auth/v2_2:libpin_auth_stub_2.2", "header":{ "header_files":[ @@ -60,7 +60,7 @@ } }, { - "name":"//drivers/interface/pin_auth/v2_1:pin_auth_idl_headers", + "name":"//drivers/interface/pin_auth/v2_2:pin_auth_idl_headers", "header":{ "header_files":[ diff --git a/pin_auth/v2_2/BUILD.gn b/pin_auth/v2_2/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..b332167fed0a8ea68d33b7e0705e80ce16078aa8 --- /dev/null +++ b/pin_auth/v2_2/BUILD.gn @@ -0,0 +1,30 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/hdi/hdi.gni") +import("../config.gni") + +hdi("pin_auth") { + module_name = "drivers_peripheral_pin_auth" + sources = [ + "IAllInOneExecutor.idl", + "ICollector.idl", + "IExecutorCallback.idl", + "IPinAuthInterface.idl", + "IVerifier.idl", + "PinAuthTypes.idl", + ] + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_pin_auth" +} diff --git a/pin_auth/v2_2/IAllInOneExecutor.idl b/pin_auth/v2_2/IAllInOneExecutor.idl new file mode 100644 index 0000000000000000000000000000000000000000..e61ffeb75ba35344bb9d6d691a3bac8462af0a5e --- /dev/null +++ b/pin_auth/v2_2/IAllInOneExecutor.idl @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfPinAuth + * @{ + * + * @brief Provides APIs for the pin auth driver. + * + * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver. + * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the pin auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + * @version 1.1 + */ + +/** + * @file IAllInOneExecutor.idl + * + * @brief Defines the APIs of the all-in-one executors. These APIs can be used to get executor information, get property, + * enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + * @version 1.1 + */ + +package ohos.hdi.pin_auth.v2_2; + +import ohos.hdi.pin_auth.v2_2.PinAuthTypes; +import ohos.hdi.pin_auth.v2_2.IExecutorCallback; + +/** + * @brief Defines the APIs of the all-in-one executors. These APIs can be used to get executor information, get property, + * enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + * @version 1.1 + */ + +interface IAllInOneExecutor { + /** + * @brief Gets executor information. + * + * @param executorInfo Indicates executor information. See {@link ExecutorInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetExecutorInfo([out] struct ExecutorInfo executorInfo); + /** + * @brief Sends parameters to the driver when executor registration is finished. + * + * @param templateIdList Indicates the templates previously registered to the user auth framework. + * @param frameworkPublicKey Indicates the framework public key. + * @param extraInfo Indicates the extra information that is sent to the executors. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, + [in] unsigned char[] extraInfo); + /** + * @brief Cancels an operation. + * + * @param scheduleId Indicates the schedule ID of the operation to cancel. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Cancel([in] unsigned long scheduleId); + /** + * @brief Send message. + * + * @param scheduleId Indicates the schedule ID of the message. + * @param srcRole is the role of source. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg); + /** + * @brief Sets pin data. + * + * @param scheduleId Indicates the schedule ID of enrollment. + * @param authSubType Indicates the pin sub type. + * @param data Indicates the pin data. + * @param data Indicates the pin length. + * @param resultCode Indicates the result code. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SetData([in] unsigned long scheduleId, [in] unsigned long authSubType, [in] unsigned char[] data, + [in] unsigned int pinLength, [in] int resultCode); + /** + * @brief Enrolls templates. + * + * @param scheduleId Indicates the schedule ID of enrollment. + * @param extraInfo Indicates the extra information of enrollment. + * @param callbackObj Indicates the callback object of enrollment. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief Authenticates templates. + * + * @param scheduleId Indicates the schedule ID of authentication. + * @param templateIdList Indicates the templates to authenticate. + * @param extraInfo Indicates the extra information of authentication. + * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, + [in] IExecutorCallback callbackObj); + /** + * @brief Deletes templates. + * + * @param templateId Indicates the templates to delete. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Delete([in] unsigned long templateId); + /** + * @brief Get property. + * + * @param templateIdList Indicates the templates to process. + * @param propertyTypes Indicates the property types to get. See {@link GetPropertyType}. + * @param property Indicates property. See {@link Property}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetProperty([in] unsigned long[] templateIdList, [in] int[] propertyTypes, [out] struct Property property); + /** + * @brief Sends a command to the driver. + * + * @param commandId Indicates the command ID. See {@link CommandId}. + * @param extraInfo Indicates the extra information of the command. + * @param callbackObj Indicates the callback object of the command. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); +} + +/** @} */ \ No newline at end of file diff --git a/pin_auth/v2_2/ICollector.idl b/pin_auth/v2_2/ICollector.idl new file mode 100644 index 0000000000000000000000000000000000000000..dab2ea9eab3f5181c43434242d8ed56777a26f33 --- /dev/null +++ b/pin_auth/v2_2/ICollector.idl @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfPinAuth + * @{ + * + * @brief Provides APIs for the pin auth driver. + * + * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver. + * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the pin auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + * @version 1.0 + */ + +/** + * @file ICollector.idl + * + * @brief Defines the APIs of the collectors. These APIs can be used to get executor information, + * cancel, collect data, and send message, etc. + * + * @since 5.0 + * @version 1.0 + */ + +package ohos.hdi.pin_auth.v2_2; + +import ohos.hdi.pin_auth.v2_2.PinAuthTypes; +import ohos.hdi.pin_auth.v2_2.IExecutorCallback; + +/** + * @brief Defines the APIs of the collectors. These APIs can be used to get executor information, + * cancel, collect data, and send message, etc. + * + * @since 5.0 + * @version 1.0 + */ + +interface ICollector { + /** + * @brief Gets executor information. + * + * @param executorInfo Indicates executor information. See {@link ExecutorInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetExecutorInfo([out] struct ExecutorInfo executorInfo); + /** + * @brief Sends parameters to the driver when executor registration is finished. + * + * @param templateIdList Indicates the templates previously registered to the user auth framework. + * @param frameworkPublicKey Indicates the framework public key. + * @param extraInfo Indicates the extra information that is sent to the executors. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo); + /** + * @brief Cancels an operation. + * + * @param scheduleId Indicates the schedule ID of the operation to cancel. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Cancel([in] unsigned long scheduleId); + /** + * @brief Send message. + * + * @param scheduleId Indicates the schedule ID of the message. + * @param srcRole is the role of source. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg); + /** + * @brief Sets pin data. + * + * @param scheduleId Indicates the schedule ID of enrollment. + * @param authSubType Indicates the pin sub type. + * @param data Indicates the pin data. + * @param data Indicates the pin length. + * @param resultCode Indicates the result code. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SetData([in] unsigned long scheduleId, [in] unsigned long authSubType, [in] unsigned char[] data, + [in] unsigned int pinLength, [in] int resultCode); + /** + * @brief Collect template data. + * + * @param scheduleId Indicates the schedule ID of collection. + * @param extraInfo Indicates the extra information of collection. + * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Collect([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, + [in] IExecutorCallback callbackObj); +} +/** @} */ \ No newline at end of file diff --git a/pin_auth/v2_2/IExecutorCallback.idl b/pin_auth/v2_2/IExecutorCallback.idl new file mode 100644 index 0000000000000000000000000000000000000000..ebe2184ebe1fc68dfaada69f2e7f29f365522dc8 --- /dev/null +++ b/pin_auth/v2_2/IExecutorCallback.idl @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfPinAuth + * @{ + * + * @brief Provides APIs for the pin auth driver. + * + * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver. + * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the pin auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @file IExecutorCallback.idl + * + * @brief Defines the callback for an async API, which can be used to report operation results or + * get information of the async API. + * + * @since 3.2 + * @version 1.0 + */ + +package ohos.hdi.pin_auth.v2_2; + +import ohos.hdi.pin_auth.v2_2.PinAuthTypes; + +/** + * @brief Defines the callback for an async API, which can be used to report operation results or + * get information of the async API. See {@link IExecutor}. + * + * @since 3.2 + * @version 1.0 + */ +[callback] interface IExecutorCallback { + /** + * @brief Defines the function for reporting operation results. + * + * @param result Indicates the result code. + * @param extraInfo Indicates extra information to report. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + OnResult([in] int result, [in] unsigned char[] extraInfo); + /** + * @brief Defines the function for reporting information in process. + * + * @param tip Indicates tip code. See {@link FaceTipsCode}. + * @param extraInfo Indicates extra information to report. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + OnTip([in] int tip, [in] unsigned char[] extraInfo); + /** + * @brief Defines the function for getting pin data. + * + * @param algoParameter is the parameter of the algorithm. + * @param authSubType Indicates the pin sub type. + * @param algoVersion is the version of the algorithm. + * @param challenge is challenge. + * @param complexityReg Indicates the complexity reg. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + OnGetData([in] unsigned char[] algoParameter, [in] unsigned long authSubType, [in] unsigned int algoVersion, + [in] unsigned char[] challenge, [in] String complexityReg); + /** + * @brief Defines the function for reporting message. + * + * @param destRole is the role of destination. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + OnMessage([in] int destRole, [in] unsigned char[] msg); +} +/** @} */ \ No newline at end of file diff --git a/pin_auth/v2_2/IPinAuthInterface.idl b/pin_auth/v2_2/IPinAuthInterface.idl new file mode 100644 index 0000000000000000000000000000000000000000..78058b590732113e58af62b5cf213020bf9f44af --- /dev/null +++ b/pin_auth/v2_2/IPinAuthInterface.idl @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfPinAuth + * @{ + * + * @brief Provides APIs for the pin auth driver. + * + * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver. + * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the pin auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @file IPinAuthInterface.idl + * + * @brief Defines the API for getting the executor list of the pin auth driver. + * of driver. + * + * @since 3.2 + * @version 1.0 + */ + +package ohos.hdi.pin_auth.v2_2; + +import ohos.hdi.pin_auth.v2_2.IAllInOneExecutor; +import ohos.hdi.pin_auth.v2_2.ICollector; +import ohos.hdi.pin_auth.v2_2.IVerifier; + +/** + * @brief Defines the API for getting the executor list of the pin auth driver. + * + * @since 3.2 + * @version 1.0 + */ +interface IPinAuthInterface { + /** + * @brief Obtains the executor list of the driver. + * + * @param allInOneExecutors Indicates the all-in-one executor list of the driver. + * See {@link IAllInOneExecutor}. + * @param verifiers Indicates the verifier list of the driver. See {@link IVerifier}. + * @param collectors Indicates the collector list of the driver. See {@link ICollector}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + GetExecutorList([out] IAllInOneExecutor[] allInOneExecutors, [out] IVerifier[] verifiers, + [out] ICollector[] collectors); +} +/** @} */ \ No newline at end of file diff --git a/pin_auth/v2_2/IVerifier.idl b/pin_auth/v2_2/IVerifier.idl new file mode 100644 index 0000000000000000000000000000000000000000..bd555e779aaf1170b7c4558eff47597f292b1d54 --- /dev/null +++ b/pin_auth/v2_2/IVerifier.idl @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfPinAuth + * @{ + * + * @brief Provides APIs for the pin auth driver. + * + * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver. + * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the pin auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + * @version 1.0 + */ + +/** + * @file IVerifier.idl + * + * @brief Defines the APIs of the verifiers. These APIs can be used to get executor information, + * cancel, authenticate, and send message, etc. + * + * @since 5.0 + * @version 1.0 + */ + +package ohos.hdi.pin_auth.v2_2; + +import ohos.hdi.pin_auth.v2_2.PinAuthTypes; +import ohos.hdi.pin_auth.v2_2.IExecutorCallback; + +/** + * @brief Defines the APIs of the verifiers. These APIs can be used to get executor information, + * cancel, authenticate, and send message, etc. + * + * @since 5.0 + * @version 1.0 + */ + +interface IVerifier { + /** + * @brief Gets executor information. + * + * @param executorInfo Indicates executor information. See {@link ExecutorInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetExecutorInfo([out] struct ExecutorInfo executorInfo); + /** + * @brief Sends parameters to the driver when executor registration is finished. + * + * @param templateIdList Indicates the templates previously registered to the user auth framework. + * @param frameworkPublicKey Indicates the framework public key. + * @param extraInfo Indicates the extra information that is sent to the executors. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, + [in] unsigned char[] extraInfo); + /** + * @brief Cancels an operation. + * + * @param scheduleId Indicates the schedule ID of the operation to cancel. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Cancel([in] unsigned long scheduleId); + /** + * @brief Send message. + * + * @param scheduleId Indicates the schedule ID of the message. + * @param srcRole is the role of source. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg); + /** + * @brief Authenticates templates. + * + * @param scheduleId Indicates the schedule ID of authentication. + * @param templateIdList Indicates the templates to authenticate. + * @param extraInfo Indicates the extra information of authentication. + * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, + [in] IExecutorCallback callbackObj); + /** + * @brief Notify collector ready. + * + * @param scheduleId Indicates the schedule ID of the message. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + NotifyCollectorReady([in] unsigned long scheduleId); +} +/** @} */ \ No newline at end of file diff --git a/pin_auth/v2_2/PinAuthTypes.idl b/pin_auth/v2_2/PinAuthTypes.idl new file mode 100644 index 0000000000000000000000000000000000000000..6a4caec03b4b7e0a61e47cf9301d46d7b0b14fa6 --- /dev/null +++ b/pin_auth/v2_2/PinAuthTypes.idl @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfPinAuth + * @{ + * + * @brief Provides APIs for the pin auth driver. + * + * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver. + * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the pin auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 3.2 + * @version 1.0 + */ + +/** + * @fiPinTypes.idl + * + * @brief Defines the enumeration and data structure of the pin auth driver, including AuthType, ExecutorRole, + * ExecutorSecureLevel, + * CommandId, ResultCode, ExecutorInfo, and TemplateInfo. + * + * @since 3.2 + * @version 1.0 + */ + +package ohos.hdi.pin_auth.v2_2; + +/** + * @brief Enumerates the credential types for authentication. + * + * @since 3.2 + * @version 1.1 + */ +enum AuthType : int { + /**< Indicates that the authentication type is PIN. */ + PIN = 1, + /**< Indicates that the authentication type is face. */ + FACE = 2, + /**< Indicates that the authentication type is fingerprint. */ + FINGERPRINT = 4, + /**< Indicates that the authentication type is recovery key. */ + RECOVERY_KEY = 8, + /**< Indicates that the authentication type is private pin. */ + PRIVATE_PIN = 16, +}; + +/** + * @brief Enumerates executor roles. + * + * @since 3.2 + * @version 2.0 + */ +enum ExecutorRole : int { + /**< Indicates that the executor role is scheduler. */ + SCHEDULER = 0, + /**< Indicates that the executor role is collector. */ + COLLECTOR = 1, + /**< Indicates that the executor role is verifier. */ + VERIFIER = 2, + /**< Indicates that the executor role is the combination of collector and verifier. */ + ALL_IN_ONE = 3, +}; + +/** + * @brief Enumerates executor secure levels. + * + * @since 3.2 + * @version 1.0 + */ +enum ExecutorSecureLevel : int { + /**< Indicates that the executor secure level is ESL0. */ + ESL0 = 0, + /**< Indicates that the executor secure level is ESL1. */ + ESL1 = 1, + /**< Indicates that the executor secure level is ESL2. */ + ESL2 = 2, + /**< Indicates that the executor secure level is ESL3. */ + ESL3 = 3, +}; + +/** + * @brief Indicates executor information. + * + * @since 3.2 + * @version 2.0 + */ +struct ExecutorInfo { + /**< Indicates the sensor ID, which must be unique within the driver. */ + unsigned short sensorId; + /**< Indicates the executor matcher. */ + unsigned int executorMatcher; + /**< Indicates the executor role. See @{ExecutorRole}. */ + int executorRole; + /**< Indicates the auth type. See @{AuthType}. */ + int authType; + /**< Indicates the executor secure level. See @{ExecutorSecureLevel}. */ + int esl; + /**< Indicates the public key of the executor. */ + unsigned char[] publicKey; + /**< Indicates extra information. */ + unsigned char[] extraInfo; + /**< Indicates the max acl of template. */ + unsigned int maxTemplateAcl; +}; + +/** + * @brief Enumerates get Property types. + * + * @since 4.0 + * @version 2.0 + */ +enum GetPropertyType : int { + /**< Indicates that the property to get is auth sub type. */ + AUTH_SUB_TYPE = 1, + /**< Indicates that the property to get is lockout duration. */ + LOCKOUT_DURATION = 2, + /**< Indicates that the property to get is remain attempts. */ + REMAIN_ATTEMPTS = 3, + /**< Indicates that the property to get is lockout duration after next fail. */ + NEXT_FAIL_LOCKOUT_DURATION = 6, + /**< Indicates that the property to get is credential length. */ + CREDENTIAL_LENGTH = 7 +}; + +/** + * @brief Indicates executor property. + * + * @since 4.0 + * @version 2.0 + */ +struct Property { + /**< Indicates auth sub type. */ + unsigned long authSubType; + /**< Indicates lockout duration. */ + int lockoutDuration; + /**< Indicates remain attempts. */ + int remainAttempts; + /**< Indicates next fail lockout duration. */ + int nextFailLockoutDuration; + /**< Indicates credential length. */ + unsigned int credentialLength; +}; + +/** + * @brief Enumerates command IDs. + * + * @since 5.0 + * @version 1.0 + */ +enum CommandId : int { + /**< The vendor may add a custom command ID after this. */ + RESET_LOCKOUT_DURATION = 1, + VENDOR_COMMAND_BEGIN = 10000 +}; + +/** @} */ \ No newline at end of file