| CLASS info |
| public class BioAuthnPrompt extends java.lang.Object |
| FIDO BioAuthn指纹认证API的主入口 |
| Type | Name | Desc |
| int | ERROR_HW_UNAVAILABLE | 硬件不可用。请稍后再试。 |
| int | ERROR_UNABLE_TO_PROCESS | 当传感器无法处理当前图像时返回错误状态。 |
| int | ERROR_TIMEOUT | 当前请求运行太久时返回错误状态。 |
| int | ERROR_NO_SPACE | 没有足够的存储空间来完成操作。 |
| int | ERROR_CANCELED | 由于指纹认证传感器不可用,操作被取消。 |
| int | ERROR_LOCKOUT | 由于尝试次数太多,API被锁定,操作被取消。 |
| int | ERROR_VENDOR | 厂商自定义错误。 |
| int | ERROR_LOCKOUT_PERMANENT | 因为错误锁定发生的次数太多,操作被取消。 |
| int | ERROR_USER_CANCELED | 用户取消了操作。 |
| int | ERROR_NO_BIOMETRICS | 用户没有注册任何指纹。 |
| int | ERROR_HW_NOT_PRESENT | 设备没有指纹传感器。 |
| int | ERROR_NEGATIVE_BUTTON | 用户按下了否定按钮。 |
| int | ERROR_NO_DEVICE_CREDENTIAL | 设备没有设置PIN码、图形解锁或密码。 |
| int | ERROR_SYS_INTEGRITY_FAILED | 系统完整性检查失败。 |
| int | ERROR_CRYPTO_VERIFY_FAILED | 使用密钥加密验证认证结果失败。 |
| int | ERROR_HMS_FRAMEWORK_ERROR | HMS Core框架错误。 |
| int | ERROR_UNSUPPORTED_OS_VER | 操作系统版本不支持指纹认证。 |
| Method name |
BioAuthnPrompt(androidx.fragment.app.FragmentActivity fragmentActivity, java.util.concurrent.Executor executor, BioAuthnCallback callback) 构造一个用户可用于指纹认证的BioAuthnPrompt对象,这个对象用于调用 FIDO BioAuthn指纹认证API。 |
BioAuthnPrompt(androidx.fragment.app.Fragment fragment, java.util.concurrent.Executor executor, BioAuthnCallback callback) 构造一个用户可用于指纹认证的BioAuthnPrompt对象,这个对象用于调用 FIDO BioAuthn指纹认证API。 |
| Return type | Method name |
| void | auth(final BioAuthnPrompt.PromptInfo info, final CryptoObject crypto) 展示一个指纹认证提示窗口,提示用户进行指纹认证。此方法关联一个秘钥或公私钥对,当指纹认证通过后才能使用关联的秘钥或公私钥对。 |
| void | auth(final BioAuthnPrompt.PromptInfo info) 展示一个指纹认证提示窗口,提示用户进行指纹认证。 |
| void | 取消展示指纹认证提示窗口。 |
| Constant |
| public static final int ERROR_HW_UNAVAILABLE |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 1 硬件不可用。请稍后再试。 |
| Constant |
| public static final int ERROR_UNABLE_TO_PROCESS |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 2 当传感器无法处理当前图像时返回错误状态。 |
| Constant |
| public static final int ERROR_TIMEOUT |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 3 当前请求运行太久时返回错误状态。这是为了防止程序无限期地等待指纹传感器。超时是特定于平台和传感器的,但通常为30秒。 |
| Constant |
| public static final int ERROR_NO_SPACE |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 4 为注册等操作返回错误状态;操作无法完成,因为没有足够的存储空间来完成该操作。 |
| Constant |
| public static final int ERROR_CANCELED |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 5 由于指纹认证传感器不可用,操作被取消。 |
| Constant |
| public static final int ERROR_LOCKOUT |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 7 由于尝试次数太多,API被锁定,操作被取消。这发生在5次失败的尝试之后,持续30秒。 |
| Constant |
| public static final int ERROR_VENDOR |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 8 厂商自定义错误。 |
| Constant |
| public static final int ERROR_LOCKOUT_PERMANENT |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 9 操作被取消,因为错误锁定发生的次数太多。在用户使用强认证(PIN/Pattern/Password)解锁之前,指纹认证将被禁用 |
| Constant |
| public static final int ERROR_USER_CANCELED |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 10 用户取消了操作。收到此消息后,应用程序应使用备用认证(例如密码)。应用程序还应提供返回指纹认证的方法,如“使用”按钮。 |
| Constant |
| public static final int ERROR_NO_BIOMETRICS |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 11 用户没有注册任何指纹。 |
| Constant |
| public static final int ERROR_HW_NOT_PRESENT |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 12 设备没有指纹传感器。 |
| Constant |
| public static final int ERROR_NEGATIVE_BUTTON |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 13 用户按下了否定按钮。 |
| Constant |
| public static final int ERROR_NO_DEVICE_CREDENTIAL |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 14 设备没有设置PIN码、图形解锁或密码。 |
| Constant |
| public static final int ERROR_SYS_INTEGRITY_FAILED |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 1001 系统完整性检查失败,比如设备已root、被刷机,或系统被破坏。 |
| Constant |
| public static final int ERROR_CRYPTO_VERIFY_FAILED |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 1002 使用密钥加密验证认证结果失败。 |
| Constant |
| public static final int ERROR_HMS_FRAMEWORK_ERROR |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 1003 HMS Core框架错误。 |
| Constant |
| public static final int ERROR_UNSUPPORTED_OS_VER |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 1004 操作系统版本不支持指纹认证。支持FIDO BioAuthn指纹认证的设备需满足 EMUI >=5.0.0 |
| Method |
| public BioAuthnPrompt(androidx.fragment.app.FragmentActivity fragmentActivity, java.util.concurrent.Executor executor, BioAuthnCallback callback) |
Parameters
| Parameter name | Parameter desc |
| fragmentActivity | 安卓应用的 FragmentActivity,对客户端的activity的引用。 |
| executor | 处理回调事件的执行器。 |
| callback | 用于处理认证事件的回调对象。 |
| Method |
| public BioAuthnPrompt(androidx.fragment.app.Fragment fragment, java.util.concurrent.Executor executor, BioAuthnCallback callback) |
Parameters
| Parameter name | Parameter desc |
| fragment | 安卓应用的 Fragment,对客户端的fragment的引用。 |
| executor | 处理回调事件的执行器。 |
| callback | 用于处理认证事件的回调对象。 |
| Method |
| public void auth(final BioAuthnPrompt.PromptInfo info, final CryptoObject crypto) |
| 展示一个指纹认证提示窗口,提示用户进行指纹认证。此方法关联一个秘钥或公私钥对,当指纹认证通过后才能使用关联的秘钥或公私钥对。 |
Parameters
| Parameter name | Parameter desc |
| info | 将在提示中显示的信息,使用BioAuthnPrompt.PromptInfo.Builder创建这个对象。 |
| crypto | 与指纹认证关联的加密对象。 |
| Method |
| public void auth(final BioAuthnPrompt.PromptInfo info) |
| 展示一个指纹认证提示窗口,提示用户进行指纹认证。 |
Parameters
| Parameter name | Parameter desc |
| info | 将在提示中显示的信息,使用BioAuthnPrompt.PromptInfo.Builder创建这个对象。 |
| Method |
| public void cancelAuth() |
| 取消展示指纹认证提示窗口 |
| CLASS info |
| public abstract class BioAuthnCallback extends java.lang.Object |
| 提供给BioAuthn指纹认证或面容认证的结果回调。需要由开发者完成具体实现。 |