diff --git a/zh-cn/device_api/hdi/face_auth/v2_0/FaceAuthTypes.idl b/zh-cn/device_api/hdi/face_auth/v2_0/FaceAuthTypes.idl new file mode 100644 index 0000000000000000000000000000000000000000..f8eb257ae596d0839aa397f7ea9762f08f9af427 --- /dev/null +++ b/zh-cn/device_api/hdi/face_auth/v2_0/FaceAuthTypes.idl @@ -0,0 +1,265 @@ +/* + * 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 HdfFaceAuth + * @{ + * + * @brief 提供人脸认证驱动的标准API接口。 + * + * 人脸认证驱动为人脸认证服务提供统一的访问接口。获取人脸认证驱动代理后,人脸认证服务可以调用相关接口获取执行器,获取人脸认证执行器后, + * 人脸认证服务可以调用相关接口获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 + * + * @since 3.2 + */ + +/** + * @file FaceAuthTypes.idl + * + * @brief 定义人脸认证驱动的枚举类和数据结构,包括AuthType, ExecutorRole, ExecutorSecureLevel, + * CommandId, FaceTipsCode, ExecutorInfo, 和TemplateInfo。 + * + * @since 3.2 + */ + +package ohos.hdi.face_auth.v2_0; + +/** + * @brief 枚举用户认证凭据类型。 + * + * @since 3.2 + * @version 1.0 + */ +enum AuthType : int { + /** 认证凭据类型为口令。 */ + PIN = 1, + /** 认证凭据类型为人脸。 */ + FACE = 2, + /** 认证凭据类型为指纹。 */ + FINGERPRINT = 4, +}; + +/** + * @brief 枚举执行器角色。 + * + * @since 3.2 + * @version 2.0 + */ +enum ExecutorRole : int { + /** 执行器角色为调度器。 */ + SCHEDULER = 0, + /** 执行器角色为采集器,提供用户认证时的数据采集能力,需要和认证器配合完成用户认证。 */ + COLLECTOR = 1, + /** 执行器角色为认证器,提供用户认证时数据处理能力,读取存储凭据模板信息并完成比对。 */ + VERIFIER = 2, + /** 执行器角色为全功能执行器,可提供用户认证数据采集、处理、储存及比对能力。 */ + ALL_IN_ONE = 3, +}; + +/** + * @brief 枚举执行器安全等级。 + * + * @since 3.2 + * @version 1.0 + */ +enum ExecutorSecureLevel : int { + /** 执行器安全级别为0,关键操作在无访问控制执行环境中完成。 */ + ESL0 = 0, + /** 执行器安全级别为1,关键操作在有访问控制的执行环境中完成。 */ + ESL1 = 1, + /** 执行器安全级别为2,关键操作在可信执行环境中完成。 */ + ESL2 = 2, + /** 执行器安全级别为3,关键操作在高安环境如独立安全芯片中完成。 */ + ESL3 = 3, +}; + +/** + * @brief 枚举身份验证能力等级。 + * + * @since 5.0 + * @version 1.0 + */ +enum AuthenticationCapabilityLevel : int { + /** 认证能力等级为0。 */ + ATL0 = 0, + /** 认证能力等级为10000。 */ + ATL1 = 10000, + /** 认证能力等级为20000。 */ + ATL2 = 20000, + /** 认证能力等级为30000。 */ + ATL3 = 30000, + /** 认证能力等级为40000。 */ + ATL4 = 40000, +}; + +/** + * @brief 执行器信息。 + * + * @since 3.2 + * @version 2.0 + */ +struct ExecutorInfo { + /** 传感器ID,不同传感器在人脸认证驱动内的唯一标识。 */ + unsigned short sensorId; + /** 执行器匹配器。 */ + unsigned int executorMatcher; + /** 身份验证能力级别@{AuthenticationCapabilityLevel}。 */ + unsigned int maxTemplateAcl; + /** 执行器角色@{ExecutorRole}。 */ + int executorRole; + /** 用户认证凭据类型@{AuthType}。 */ + int authType; + /** 执行器安全等级@{ExecutorSecureLevel}。 */ + int esl; + /** 执行器公钥,用于校验该执行器私钥签名的信息。 */ + unsigned char[] publicKey; + /** 其他相关信息,用于支持信息扩展 */ + unsigned char[] extraInfo; +}; + +/** + * @brief Enumerates prompt codes. + * + * @since 3.2 + * @version 1.0 + */ +enum FaceTipsCode : int { + /** 获取的人脸图像由于光照度高而过亮。 */ + FACE_AUTH_TIP_TOO_BRIGHT = 1, + /** 获取的人脸图像由于光照度低而过暗。 */ + FACE_AUTH_TIP_TOO_DARK = 2, + /** 人脸离设备过近。 */ + FACE_AUTH_TIP_TOO_CLOSE = 3, + /** 人脸离设备过远。 */ + FACE_AUTH_TIP_TOO_FAR = 4, + /** 设备过高,只拍到人脸的上半部分。 */ + FACE_AUTH_TIP_TOO_HIGH = 5, + /** 设备过低,只拍到人脸的下半部分。 */ + FACE_AUTH_TIP_TOO_LOW = 6, + /** 设备偏右,只拍到人脸的右侧部分。 */ + FACE_AUTH_TIP_TOO_RIGHT = 7, + /** 设备偏左,只拍到人脸的左侧部分。 */ + FACE_AUTH_TIP_TOO_LEFT = 8, + /** 人脸信息采集过程中,人脸移动过多。 */ + FACE_AUTH_TIP_TOO_MUCH_MOTION = 9, + /** 用户未注视设备。 */ + FACE_AUTH_TIP_POOR_GAZE = 10, + /** 未检测到人脸。 */ + FACE_AUTH_TIP_NOT_DETECTED = 11, + /** 用于厂商自定义提示信息。 */ + VENDOR_FACE_AUTH_TIP_BEGIN = 10000 +}; + +/** + * @brief 枚举获得属性类型。 + * + * @since 4.0 + * @version 1.1 + */ +enum GetPropertyType : int { + /** 人脸认证子类型。 */ + AUTH_SUB_TYPE = 1, + /** 认证方式被冻结的时间。 */ + LOCKOUT_DURATION = 2, + /** 认证方式距离被冻结的可处理认证请求次数。 */ + REMAIN_ATTEMPTS = 3, + /** 人脸录入进程。 */ + ENROLL_PROGRESS = 4, + /** 传感器信息。 */ + SENSOR_INFO = 5 +}; + +/** + * @brief 执行器相关属性。 + * + * @since 4.0 + * @version 1.1 + */ +struct Property { + /** 人脸认证子类型。 */ + unsigned long authSubType; + /** 认证方式被冻结的时间。 */ + int lockoutDuration; + /** 认证方式距离被冻结的可处理认证请求次数。 */ + int remainAttempts; + /** 人脸录入进程。 */ + String enrollmentProgress; + /** 传感器信息。 */ + String sensorInfo; +}; + +/** + * @brief 枚举sa命令id。 + * + * @since 4.0 + * @version 1.1 + */ +enum SaCommandId : int { + /** 开始增加屏幕亮度 */ + BEGIN_SCREEN_BRIGHTNESS_INCREASE = 1, + /** 结束增加屏幕亮度 */ + END_SCREEN_BRIGHTNESS_INCREASE = 2, +}; + +/** + * @brief sa命令参数为空。 + * + * @since 4.0 + * @version 1.1 + */ +struct SaCommandParamNone { +}; + +/** + * @brief sa命令参数。 + * + * @since 4.0 + * @version 1.1 + */ +union SaCommandParam { + /** sa命令参数为空。详细说明请参考{@link SaCommandParamNone}。 */ + struct SaCommandParamNone none; +}; + +/** + * @brief SA命令相关。 + * + * @since 4.0 + * @version 2.0 + */ +struct SaCommand { + /** sa命令ID。详细说明请参考{@link SaCommandId}。 */ + int id; + /** sa命令参数。详细说明请参考{@link SaCommandParam}。 */ + union SaCommandParam param; +}; + +/** + * @brief 枚举人脸认证功能相关操作命令。 + * + * @since 5.0 + * @version 1.0 + */ +enum DriverCommandId : int { + /** 锁定人脸模版。 */ + LOCK_TEMPLATE = 1, + /** 解锁人脸模版。 */ + UNLOCK_TEMPLATE = 2, + /** 初始化算法。 */ + INIT_ALGORITHM = 3, + /** 用于厂商自定义操作指令。 */ + VENDOR_COMMAND_BEGIN = 10000 +}; +/** @} */ \ No newline at end of file diff --git a/zh-cn/device_api/hdi/face_auth/v2_0/IAllInOneExecutor.idl b/zh-cn/device_api/hdi/face_auth/v2_0/IAllInOneExecutor.idl new file mode 100644 index 0000000000000000000000000000000000000000..f6e465f57280e85cc88edbe514764ed6e7f3c93a --- /dev/null +++ b/zh-cn/device_api/hdi/face_auth/v2_0/IAllInOneExecutor.idl @@ -0,0 +1,173 @@ +/* + * 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 HdfFaceAuth + * @{ + * + * @brief 提供人脸认证驱动的标准API接口。 + * + * 人脸认证驱动为人脸认证服务提供统一的访问接口。获取人脸认证驱动代理后,人脸认证服务可以调用相关接口获取执行器,获取人脸认证执行器后, + * 人脸认证服务可以调用相关接口获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 + * + * @since 5.0 + */ + +/** + * @file IAllInOneExecutor.idl + * + * @brief 定义执行器接口,用于获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 + * + * @since 5.0 + */ + +package ohos.hdi.face_auth.v2_0; + +import ohos.hdi.face_auth.v2_0.FaceAuthTypes; +import ohos.hdi.face_auth.v2_0.IExecutorCallback; +import ohos.hdi.face_auth.v2_0.ISaCommandCallback; + +/** + * @brief 定义执行器接口,用于获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 + * + * @since 5.0 + * @version 1.0 + */ +interface IAllInOneExecutor { + /** + * @brief 获取执行器信息,人脸认证服务将执行器注册到用户认证框架时需要通过该接口获取对应信息。 + * + * @param 执行器信息。详细说明请参考{@link ExecutorInfo}. + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + GetExecutorInfo([out] struct ExecutorInfo executorInfo); + /** + * @brief 完成执行器注册,对人脸特征模版进行对账,用于删除无效的人脸特征模板及相关信息。 + * + * @param templateIdList 用户认证框架内由该执行器注册的人脸特征模版ID列表。 + * @param frameworkPublicKey 用户认证框架的公钥,用于校验用户认证框架私钥签名的信息。 + * @param extraInfo 其他相关信息,用于支持信息扩展。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo); + /** + * @brief 取消操作请求。 + * + * @param scheduleId 调度ID,用于标识一次操作请求的调度过程。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + Cancel([in] unsigned long scheduleId); + /** + * @brief 发送消息。 + * + * @param scheduleId 消息的调度ID。 + * @param srcRole 消息源角色。 + * @param msg 消息内容。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg); + /** + * @brief 注册人脸特征模版。 + * + * @param scheduleId 调度ID,用于标识一次操作请求的调度过程。 + * @param extraInfo 其他相关信息,用于支持信息扩展。 + * @param callbackObj 回调对象。详细说明请参考{@link IExecutorCallback}。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief Authenticates templates. + * + * @param scheduleId 调度ID,用于标识一次操作请求的调度过程。 + * @param templateIdList 指定要认证的模版ID列表。 + * @param extraInfo 其他相关信息,用于支持信息扩展。 + * @param callbackObj 回调对象。详细说明请参考{@link IExecutorCallback}。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief Identifies templates. + * + * @param scheduleId 调度ID,用于标识一次操作请求的调度过程。 + * @param extraInfo 其他相关信息,用于支持信息扩展。 + * @param callbackObj 回调对象。详细说明请参考{@link IExecutorCallback}。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + Identify([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief 删除人脸特征模版。 + * + * @param 指定要删除的模版ID列表。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + Delete([in] unsigned long[] templateIdList); + /** + * @brief 发送人脸认证功能相关操作命令。 + * + * @param commandId 操作命令ID。详细说明请参考{@link DriverCommandId}。 + * @param extraInfo 其他相关信息,用于支持信息扩展。 + * @param callbackObj 回调对象。详细说明请参考{@link IExecutorCallback}. + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief 获得人脸执行器属性。 + * + * @param templateIdList 模板id列表。 + * @param propertyTypes 人脸执行器属性类型。详细说明请参考{@link GetPropertyType}。 + * @param property 人脸执行器属性。详细说明请参考{@link Property}。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + GetProperty([in] unsigned long[] templateIdList, [in] int[] propertyTypes, [out] struct Property property); + /** + * @brief 设置缓存模板。 + * + * @param templateIdList 人脸缓存的模板列表。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + SetCachedTemplates([in] unsigned long[] templateIdList); + /** + * @brief 注册sa命令回调。 + * + * @param callbackObj 表示sa命令回调。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + RegisterSaCommandCallback([in] ISaCommandCallback callbackObj); +} +/** @} */ \ No newline at end of file diff --git a/zh-cn/device_api/hdi/face_auth/v2_0/IExecutorCallback.idl b/zh-cn/device_api/hdi/face_auth/v2_0/IExecutorCallback.idl new file mode 100644 index 0000000000000000000000000000000000000000..c8b0eda0bb39584a4078e7b5d528f11797bfde3c --- /dev/null +++ b/zh-cn/device_api/hdi/face_auth/v2_0/IExecutorCallback.idl @@ -0,0 +1,85 @@ +/* + * 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 HdfFaceAuth + * @{ + * + * @brief 提供人脸认证驱动的标准API接口。 + * + * 人脸认证驱动为人脸认证服务提供统一的访问接口。获取人脸认证驱动代理后,人脸认证服务可以调用相关接口获取执行器,获取人脸认证执行器后, + * 人脸认证服务可以调用相关接口获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 + * + * @since 3.2 + */ + +/** + * @file IExecutorCallback.idl + * + * @brief 定义异步API接口回调,用于返回异步接口的请求处理结果和信息。 + * + * @since 3.2 + */ + +package ohos.hdi.face_auth.v2_0; + +/** + * @brief 定义异步API接口回调,用于返回异步接口的请求处理结果和信息。 + * + * @since 3.2 + * @version 2.0 + */ +[callback] interface IExecutorCallback { + /** + * @brief 定义操作结果回调函数。 + * + * @param result 操作请求处理结果。 + * @param extraInfo 其他相关信息,如用户认证通过时用于返回执行器签发的认证令牌等。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + * + * @since 3.2 + * @version 1.0 + */ + OnResult([in] int result, [in] unsigned char[] extraInfo); + /** + * @brief 定义操作过程信息反馈回调函数。 + * + * @param tip 提示信息编码。详细说明请参考{@link FaceTipsCode}. + * @param extraInfo 其他相关信息,用于支持信息扩展。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + * + * @since 3.2 + * @version 2.0 + */ + OnTip([in] int tip, [in] unsigned char[] extraInfo); + /** + * @brief 定义消息回调函数。 + * + * @param destRole 目标角色。 + * @param msg 消息内容。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + * + * @since 5.0 + * @version 1.0 + */ + OnMessage([in] int destRole, [in] unsigned char[] msg); +} +/** @} */ \ No newline at end of file diff --git a/zh-cn/device_api/hdi/face_auth/v2_0/IFaceAuthInterface.idl b/zh-cn/device_api/hdi/face_auth/v2_0/IFaceAuthInterface.idl new file mode 100644 index 0000000000000000000000000000000000000000..774f947818be09065d8b665431282a27324073c4 --- /dev/null +++ b/zh-cn/device_api/hdi/face_auth/v2_0/IFaceAuthInterface.idl @@ -0,0 +1,73 @@ +/* + * 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 HdfFaceAuth + * @{ + * + * @brief 提供人脸认证驱动的标准API接口。 + * + * 人脸认证驱动为人脸认证服务提供统一的访问接口。获取人脸认证驱动代理后,人脸认证服务可以调用相关接口获取执行器,获取人脸认证执行器后, + * 人脸认证服务可以调用相关接口获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 + * + * @since 3.2 + */ + +/** + * @file IFaceAuthInterface.idl + * + * @brief 定义获取人脸认证驱动的执行器列表接口。 + * + * @since 3.2 + */ + +package ohos.hdi.face_auth.v2_0; + +import ohos.hdi.face_auth.v2_0.IAllInOneExecutor; +sequenceable ohos.hdi.camera.v1_0.BufferProducerSequenceable; + +/** + * @brief 定义获取人脸认证驱动的执行器列表接口。 + * + * @since 3.2 + * @version 2.0 + */ +interface IFaceAuthInterface { + /** + * @brief 获取执行器列表,人脸认证服务进程启动进行初始化操作时通过该接口获取人脸认证驱动支持的执行器列表。 + * + * @param allInOneExecutors 执行器对象列表。详细说明请参考{@link IAllInOneExecutor}. + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + * + * @since 3.2 + * @version 2.0 + */ + GetExecutorList([out] IAllInOneExecutor[] allInOneExecutors); + /** + * @brief 设置生产者句柄 + * + * @param bufferProducer 将生产者句柄设置为执行器 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + * + * @since 3.2 + * @version 2.0 + */ + SetBufferProducer([in] BufferProducerSequenceable bufferProducer); +} +/** @} */ \ No newline at end of file diff --git a/zh-cn/device_api/hdi/face_auth/v2_0/ISaCommandCallback.idl b/zh-cn/device_api/hdi/face_auth/v2_0/ISaCommandCallback.idl new file mode 100644 index 0000000000000000000000000000000000000000..c0808b7d332bb5e76f559680b2cec0f4c57e073b --- /dev/null +++ b/zh-cn/device_api/hdi/face_auth/v2_0/ISaCommandCallback.idl @@ -0,0 +1,60 @@ +/* + * 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 HdfFaceAuth + * @{ + * + * @brief 提供人脸认证驱动的标准API接口。 + * + * 人脸认证驱动为人脸认证服务提供统一的访问接口。获取人脸认证驱动代理后,人脸认证服务可以调用相关接口获取执行器,获取人脸认证执行器后, + * 人脸认证服务可以调用相关接口获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 + * + * @since 4.0 + */ + +/** + * @file ISaCommandCallback.idl + * + * @brief 定义异步 API 的回调,该回调可用于向 SA 发送命令。 + * + * @since 4.0 + */ + +package ohos.hdi.face_auth.v2_0; + +import ohos.hdi.face_auth.v2_0.FaceAuthTypes; + +/** + * @brief 定义异步 API 的回调,该回调可用于向 SA 发送命令。 + * + * @since 4.0 + * @version 1.1 + */ +[callback] interface ISaCommandCallback { + /** + * @brief 定义进程中sa命令的函数。 + * + * @param commands 表示SA命令。详细说明请参考{@link SaCommand}。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + * + * @since 4.0 + * @version 1.1 + */ + OnSaCommands([in] struct SaCommand[] commands); +} +/** @} */ \ No newline at end of file diff --git a/zh-cn/device_api/hdi/fingerprint_auth/v2_0/FingerprintAuthTypes.idl b/zh-cn/device_api/hdi/fingerprint_auth/v2_0/FingerprintAuthTypes.idl new file mode 100644 index 0000000000000000000000000000000000000000..2f8de3a5581cafc07e2bdcb706deeba5710b1d5f --- /dev/null +++ b/zh-cn/device_api/hdi/fingerprint_auth/v2_0/FingerprintAuthTypes.idl @@ -0,0 +1,286 @@ +/* + * 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 HdfFingerprintAuth + * @{ + * + * @brief 提供指纹认证驱动的API接口。 + * + * 指纹认证驱动程序为指纹认证服务提供统一的接口,用于访问指纹认证驱动程序。获取指纹认证驱动代理后,服务可以调用相关API获取执行器。 + * 获取指纹认证执行器后,服务可以调用相关API获取执行器信息,获取凭据模板信息、注册指纹特征模板、进行用户指纹认证、删除指纹特征模板等。 + * + * @since 3.2 + */ + +/** + * @file FingerprintAuthTypes.idl + * + * @brief 定义指纹认证驱动枚举和数据结构,包括认证类型、执行器角色、 执行器安全等级、命令ID、指纹提示信息编码、执行器信息和模板信息。 + * + * @since 3.2 + */ + +package ohos.hdi.fingerprint_auth.v2_0; + +/** + * @brief 枚举用户认证的凭据类型。 + * + * @since 3.2 + * @version 1.0 + */ +enum AuthType : int { + /**< 认证凭据类型为口令。 */ + PIN = 1, + /**< 认证凭据类型为人脸。 */ + FACE = 2, + /**< 认证凭据类型为指纹。 */ + FINGERPRINT = 4, +}; + +/** + * @brief 枚举执行器角色。 + * + * @since 3.2 + * @version 2.0 + */ +enum ExecutorRole : int { + /**< 表示执行器角色是调度器。 */ + SCHEDULER = 0, + /**< 表示执行器角色是采集器,提供用户认证时的数据采集能力,需要和认证器配合完成用户认证。 */ + COLLECTOR = 1, + /**< 表示执行器角色是认证器,提供用户认证时数据处理能力,读取存储凭据模板信息并完成比对。 */ + VERIFIER = 2, + /**< 表示执行器角色是全功能执行器,可提供用户认证数据采集、处理、储存及比对能力。 */ + ALL_IN_ONE = 3, +}; + +/** + * @brief 枚举执行器安全等级。 + * + * @since 3.2 + * @version 1.0 + */ +enum ExecutorSecureLevel : int { + /**< 表示执行器安全等级是0,关键操作在无访问控制执行环境中完成。 */ + ESL0 = 0, + /**< 表示执行器安全等级是1,关键操作在有访问控制的执行环境中完成。 */ + ESL1 = 1, + /**< 表示执行器安全等级是2,关键操作在可信执行环境中完成。 */ + ESL2 = 2, + /**< 表示执行器安全等级是3,关键操作在高安环境如独立安全芯片中完成。 */ + ESL3 = 3, +}; + +/** + * @brief 枚举身份验证能力等级。 + * + * @since 5.0 + * @version 1.0 + */ +enum AuthenticationCapabilityLevel : int { + /**< 认证能力等级为0。 */ + ATL0 = 0, + /**< 认证能力等级为10000。 */ + ATL1 = 10000, + /**< 认证能力等级为20000。 */ + ATL2 = 20000, + /**< 认证能力等级为30000。 */ + ATL3 = 30000, + /**< 认证能力等级为40000。 */ + ATL4 = 40000, +}; + +/** + * @brief 执行器信息。 + * + * @since 3.2 + * @version 2.0 + */ +struct ExecutorInfo { + /**< 传感器ID,不同传感器在指纹认证驱动内的唯一标识。 */ + unsigned short sensorId; + /**< 执行器匹配器。 */ + unsigned int executorMatcher; + /**< 身份验证能力级别@{AuthenticationCapabilityLevel}。 */ + unsigned int maxTemplateAcl; + /**< 执行器角色@{ExecutorRole}。 */ + int executorRole; + /**< 用户认证凭据类型@{AuthType}。 */ + int authType; + /**< 执行器安全等级@{ExecutorSecureLevel}。 */ + int esl; + /**< 执行器公钥,用于校验该执行器私钥签名的信息。 */ + unsigned char[] publicKey; + /**< 其他相关信息,用于支持信息扩展。 */ + unsigned char[] extraInfo; +}; + +/** + * @brief 枚举提示信息编码。 + * + * @since 3.2 + * @version 1.2 + */ +enum FingerprintTipsCode : int { + /**< 获取的指纹图像是完整的。 */ + FINGERPRINT_AUTH_TIP_GOOD = 0, + /**< 指纹图像非常模糊,原因是传感器上存在可疑或检测到的污垢。 */ + FINGERPRINT_AUTH_TIP_DIRTY = 1, + /**< 仅检测到部分指纹图像。 */ + FINGERPRINT_AUTH_TIP_INSUFFICIENT = 2, + /**< 仅检测到部分指纹图像。 */ + FINGERPRINT_AUTH_TIP_PARTIAL = 3, + /**< 指纹图像由于快速移动而不完整。 */ + FINGERPRINT_AUTH_TIP_TOO_FAST = 4, + /**< 指纹图像由于没有移动而无法读取。 */ + FINGERPRINT_AUTH_TIP_TOO_SLOW = 5, + /**< 指纹向下移动。 */ + FINGERPRINT_AUTH_TIP_FINGER_DOWN = 6, + /**< 指纹向上移动。 */ + FINGERPRINT_AUTH_TIP_FINGER_UP = 7, + /**< 单个认证结果。 认证结果以json格式携带字符串: + character string: {"authResult":1,"authRemainAttempts":3,"lockoutDuration":0} */ + FINGERPRINT_AUTH_TIP_SINGLE_AUTH_RESULT = 8, + /**< 用于厂商自定义提示信息。 */ + VENDOR_FINGERPRINT_AUTH_TIP_BEGIN = 10000 +}; + +/** + * @brief 获取指纹执行器属性。 + * + * @since 4.0 + * @version 1.1 + */ +enum GetPropertyType : int { + /** 获取认证子类型。 */ + AUTH_SUB_TYPE = 1, + /** 获取指纹剩余锁定时间。 */ + LOCKOUT_DURATION = 2, + /** 获取指纹剩余比对次数。 */ + REMAIN_ATTEMPTS = 3, + /** 获取指纹录入进度。 */ + ENROLL_PROGRESS = 4, + /** 获取指纹光斑的信息。 */ + SENSOR_INFO = 5 +}; + +/** + * @brief 执行器属性。 + * + * @since 4.0 + * @version 1.1 + */ +struct Property { + /** 认证子类型。 */ + unsigned long authSubType; + /** 指纹剩余锁定时间。 */ + int lockoutDuration; + /** 指纹剩余可重试次数。 */ + int remainAttempts; + /** 指纹录入进度。 */ + String enrollmentProgress; + /** 指纹光斑信息。 */ + String sensorInfo; +}; + +/** + * @brief 枚举sa命令ID。 + * + * @since 4.0 + * @version 1.1 + */ +enum SaCommandId : int { + /** 打开光斑功能。 */ + ENABLE_SENSOR_ILLUMINATION = 1, + /** 关闭光斑功能。 */ + DISABLE_SENSOR_ILLUMINATION = 2, + /** 点亮光斑。 */ + TURN_ON_SENSOR_ILLUMINATION = 3, + /** 熄灭光斑。 */ + TURN_OFF_SENSOR_ILLUMINATION = 4, +}; + +/** + * @brief 光斑使能的sa命令参数。 + * + * @since 4.0 + * @version 1.1 + */ +struct SaCommandParamEnableSensorIllumination { + /** 高亮显示圆心x坐标与屏幕宽度的比值。 */ + unsigned int centerX; + /** 高亮显示圆心y坐标与屏幕高度的比值。 */ + unsigned int centerY; + /** 高亮显示圆半径,单位为px。 */ + unsigned int radius; + /** 高亮显示亮度。 */ + unsigned int brightness; + /** 高亮显示颜色。 */ + unsigned int color; +}; + +/** + * @brief sa命令参数为空。 + * + * @since 4.0 + * @version 1.1 + */ +struct SaCommandParamNone { +}; + +/** + * @brief sa命令参数。 + * + * @since 4.0 + * @version 1.1 + */ +union SaCommandParam { + /** sa命令参数为空,参见{@link SaCommandParamNone}。 */ + struct SaCommandParamNone none; + /** sa命令参数是打开光斑使能 ,参见{@link SaCommandParamEnableSensorIllumination}。 */ + struct SaCommandParamEnableSensorIllumination enableSensorIllumination; +}; + +/** + * @brief sa命令ID + * + * @since 4.0 + * @version 2.0 + */ +struct SaCommand { + /** sa命令ID。见{@link SaCommandId}。 */ + int id; + /** sa命令参数。见{@link SaCommandParam}。 */ + union SaCommandParam param; +}; + +/** + * @brief 枚举指纹驱动命令ID。 + * + * @since 5.0 + * @version 1.0 + */ +enum DriverCommandId : int { + /** 锁定指纹模版。 */ + LOCK_TEMPLATE = 1, + /** 解锁指纹模版。 */ + UNLOCK_TEMPLATE = 2, + /** 初始化算法。 */ + INIT_ALGORITHM = 3, + /** 用于厂商自定义操作指令。 */ + VENDOR_COMMAND_BEGIN = 10000 +}; +/** @} */ \ No newline at end of file diff --git a/zh-cn/device_api/hdi/fingerprint_auth/v2_0/IAllInOneExecutor.idl b/zh-cn/device_api/hdi/fingerprint_auth/v2_0/IAllInOneExecutor.idl new file mode 100644 index 0000000000000000000000000000000000000000..7ee3943f7a055bc80b63fae076cc49d6ec5cec50 --- /dev/null +++ b/zh-cn/device_api/hdi/fingerprint_auth/v2_0/IAllInOneExecutor.idl @@ -0,0 +1,175 @@ +/* + * 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 HdfFingerprintAuth + * @{ + * + * @brief 提供指纹认证驱动的API接口。 + * + * 指纹认证驱动程序为指纹认证服务提供统一的接口,用于访问指纹认证驱动程序。获取指纹认证驱动代理后,服务可以调用相关API获取执行器。 + * 获取指纹认证执行器后,服务可以调用相关API获取执行器信息,获取凭据模板信息、注册指纹特征模板、进行用户指纹认证、删除指纹特征模板等。 + * + * @since 5.0 + */ + +/** + * @file IAllInOneExecutor.idl + * + * @brief 定义执行器接口,用于获取执行器,获取凭据模版信息,注册指纹特征模版,进行用户指纹认证,删除指纹特征模版等。 + * + * @since 5.0 + */ + +package ohos.hdi.fingerprint_auth.v2_0; + +import ohos.hdi.fingerprint_auth.v2_0.FingerprintAuthTypes; +import ohos.hdi.fingerprint_auth.v2_0.IExecutorCallback; +import ohos.hdi.fingerprint_auth.v2_0.ISaCommandCallback; + +/** + * @brief 定义执行器接口,用于获取执行器,获取凭据模版信息,注册指纹特征模版,进行用户指纹认证,删除指纹特征模版等。 + * + * @since 5.0 + * @version 1.0 + */ +interface IAllInOneExecutor { + /** + * @brief 获取执行器信息。 + * + * @param executorInfo 执行器信息{@link ExecutorInfo}。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + GetExecutorInfo([out] struct ExecutorInfo executorInfo); + /** + * @brief 完成执行器注册,对指纹特征模版进行对账,用于删除无效的指纹特征模板及相关信息。 + * + * @param templateIdList 用户认证框架内由该执行器注册的指纹特征模版ID列表。 + * @param frameworkPublicKey 用户认证框架的公钥,用于校验用户认证框架私钥签名的信息。 + * @param extraInfo 其他相关信息,用于支持信息扩展。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo); + /** + * @brief 取消操作请求。 + * + * @param scheduleId 调度ID,用于标识一次操作请求的调度过程。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + Cancel([in] unsigned long scheduleId); + /** + * @brief 消息发送操作。 + * + * @param scheduleId 调度ID,用于标识一次消息发送的调度过程。 + * @param srcRole 消息源角色。 + * @param msg 消息内容。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg); + /** + * @brief 注册指纹特征模版。 + * + * @param scheduleId 调度ID,用于标识一次操作请求的调度过程。 + * @param extraInfo 其他相关信息,用于支持信息扩展。 + * @param callbackObj 回调对象{@link IExecutorCallback}。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief 指纹认证。 + * + * @param scheduleId 调度ID,用于标识一次操作请求的调度过程。 + * @param templateIdList 指定要认证的模版ID列表。 + * @param endAfterFirstFail 第一次认证失败后结束认证。 + * @param extraInfo 其他相关信息,用于支持信息扩展。 + * @param callbackObj 回调对象{@link IExecutorCallback}。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] boolean endAfterFirstFail, + [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief 指纹识别。 + * + * @param scheduleId 调度ID,用于标识一次操作请求的调度过程。 + * @param extraInfo 其他相关信息,用于支持信息扩展。 + * @param callbackObj 回调对象{@link IExecutorCallback}。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + Identify([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief 删除指纹特征模版。 + * + * @param templateIdList 指定要删除的模版ID列表。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + Delete([in] unsigned long[] templateIdList); + /** + * @brief 发送指纹认证功能相关操作命令。 + * + * @param commandId 操作命令ID{@link DriverCommandId}。 + * @param extraInfo 其他相关信息,用于支持信息扩展。 + * @param callbackObj 回调对象{@link IExecutorCallback}。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief 获取指纹执行器属性。 + * + * @param templateIdList 指定要认证的模版ID列表。 + * @param propertyTypes 指纹执行器属性类型,见{@link GetPropertyType}。 + * @param property 指纹执行器属性{@link Property}。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + GetProperty([in] unsigned long[] templateIdList, [in] int[] propertyTypes, [out] struct Property property); + /** + * @brief 设置指纹缓存模板。 + * + * @param templateIdList 指纹缓存模板列表。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。· + */ + SetCachedTemplates([in] unsigned long[] templateIdList); + /** + * @brief 注册sa命令回调。 + * + * @param callbackObj sa命令回调对象。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + */ + RegisterSaCommandCallback([in] ISaCommandCallback callbackObj); +} +/** @} */ \ No newline at end of file diff --git a/zh-cn/device_api/hdi/fingerprint_auth/v2_0/IExecutorCallback.idl b/zh-cn/device_api/hdi/fingerprint_auth/v2_0/IExecutorCallback.idl new file mode 100644 index 0000000000000000000000000000000000000000..fc41d0c242b87466e3750d7ec99433c2ec48b00c --- /dev/null +++ b/zh-cn/device_api/hdi/fingerprint_auth/v2_0/IExecutorCallback.idl @@ -0,0 +1,85 @@ +/* + * 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 HdfFingerprintAuth + * @{ + * + * @brief 提供指纹认证驱动的API接口。 + * + * 指纹认证驱动程序为指纹认证服务提供统一的接口,用于访问指纹认证驱动程序。获取指纹认证驱动代理后,服务可以调用相关API获取执行器。 + * 获取指纹认证执行器后,服务可以调用相关API获取执行器信息,获取凭据模板信息、注册指纹特征模板、进行用户指纹认证、删除指纹特征模板等。 + * + * @since 3.2 + */ + +/** + * @file IExecutorCallback.idl + * + * @brief 定义异步API接口回调,用于返回异步接口的请求处理结果和信息。 + * + * @since 3.2 + */ + +package ohos.hdi.fingerprint_auth.v2_0; + +/** + * @brief 定义异步API接口回调,用于返回异步接口的请求处理结果和信息。 + * + * @since 3.2 + * @version 2.0 + */ +[callback] interface IExecutorCallback { + /** + * @brief 定义操作结果回调函数。 + * + * @param result 操作请求处理结果。 + * @param extraInfo 其他相关信息,如用户认证通过时用于返回执行器签发的认证令牌等。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + * + * @since 3.2 + * @version 1.0 + */ + OnResult([in] int result, [in] unsigned char[] extraInfo); + /** + * @brief 定义操作过程信息反馈回调函数。 + * + * @param tip 提示信息编码{@link FaceTipsCode}。 + * @param extraInfo 其他相关信息,用于支持信息扩展。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + * + * @since 3.2 + * @version 2.0 + */ + OnTip([in] int tip, [in] unsigned char[] extraInfo); + /** + * @brief 定义消息回调函数。 + * + * @param destRole 目标角色。 + * @param msg 消息内容。 + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + * + * @since 5.0 + * @version 1.0 + */ + OnMessage([in] int destRole, [in] unsigned char[] msg); +} +/** @} */ \ No newline at end of file diff --git a/zh-cn/device_api/hdi/fingerprint_auth/v2_0/IFingerprintAuthInterface.idl b/zh-cn/device_api/hdi/fingerprint_auth/v2_0/IFingerprintAuthInterface.idl new file mode 100644 index 0000000000000000000000000000000000000000..22d09ca241a5b1e98bd123bf0f7cb45a208fd48b --- /dev/null +++ b/zh-cn/device_api/hdi/fingerprint_auth/v2_0/IFingerprintAuthInterface.idl @@ -0,0 +1,60 @@ +/* + * 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 HdfFingerprintAuth + * @{ + * + * @brief 提供指纹认证驱动的API接口。 + * + * 指纹认证驱动程序为指纹认证服务提供统一的接口,用于访问指纹认证驱动程序。获取指纹认证驱动代理后,服务可以调用相关API获取执行器。 + * 获取指纹认证执行器后,服务可以调用相关API获取执行器信息,获取凭据模板信息、注册指纹特征模板、进行用户指纹认证、删除指纹特征模板等。 + * + * @since 3.2 + */ + +/** + * @file IFingerprintAuthInterface.idl + * + * @brief 定义指纹认证驱动的执行器列表接口。此接口可用于获取驱动的执行器列表。 + * + * @since 3.2 + */ + +package ohos.hdi.fingerprint_auth.v2_0; + +import ohos.hdi.fingerprint_auth.v2_0.IAllInOneExecutor; + +/** + * @brief 定义获取指纹认证驱动的执行器列表接口。 + * + * @since 3.2 + * @version 2.0 + */ +interface IFingerprintAuthInterface { + /** + * @brief 获取执行器列表,指纹认证服务进程启动进行初始化操作时通过该接口获取指纹认证驱动支持的执行器列表。 + * + * @param allInOneExecutors 执行器对象列表{@link IAllInOneExecutor}. + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + * + * @since 3.2 + * @version 2.0 + */ + GetExecutorList([out] IAllInOneExecutor[] allInOneExecutors); +} +/** @} */ \ No newline at end of file diff --git a/zh-cn/device_api/hdi/fingerprint_auth/v2_0/ISaCommandCallback.idl b/zh-cn/device_api/hdi/fingerprint_auth/v2_0/ISaCommandCallback.idl new file mode 100644 index 0000000000000000000000000000000000000000..039929fea90dff9d18c963d6fcc93021f0c9b7e3 --- /dev/null +++ b/zh-cn/device_api/hdi/fingerprint_auth/v2_0/ISaCommandCallback.idl @@ -0,0 +1,60 @@ +/* + * 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 HdfFingerprintAuth + * @{ + * + * @brief 提供指纹认证驱动的API接口。 + * + * 指纹认证驱动程序为指纹认证服务提供统一的接口,用于访问指纹认证驱动程序。获取指纹认证驱动代理后,服务可以调用相关API获取执行器。 + * 获取指纹认证执行器后,服务可以调用相关API获取执行器信息,获取凭据模板信息、注册指纹特征模板、进行用户指纹认证、删除指纹特征模板等。 + * + * @since 4.0 + */ + +/** + * @file ISaCommandCallback.idl + * + * @brief 定义异步API接口回调,可以发送命令给SA。 + * + * @since 4.0 + */ + +package ohos.hdi.fingerprint_auth.v2_0; + +import ohos.hdi.fingerprint_auth.v2_0.FingerprintAuthTypes; + +/** + * @brief 定义异步API接口回调,可以发送命令给SA。 + * + * @since 4.0 + * @version 1.1 + */ +[callback] interface ISaCommandCallback { + /** + * @brief 定义SA命令过程回调函数。 + * + * @param commands SA命令见{@link SaCommand}. + * + * @return 0 表示操作成功。 + * @return 非0 表示操作失败。 + * + * @since 4.0 + * @version 1.1 + */ + OnSaCommands([in] struct SaCommand[] commands); +} +/** @} */ \ No newline at end of file