智能客服
你问我答,随时在线为你解决问题
此版本文档已归档不再维护,推荐您使用最新版本。
| CLASS info |
| public class FingerprintManager extends java.lang.Object |
| FIDO BioAuthn 指纹认证API的主入口。 |
| Method name |
FingerprintManager(android.app.Activity activity, java.util.concurrent.Executor executor, BioAuthnCallback callback) 构造一个用户可用于指纹认证的FingerprintManager对象,这个对象用于调用 FIDO BioAuthn指纹认证API。 |
FingerprintManager(android.app.Fragment fragment, java.util.concurrent.Executor executor, BioAuthnCallback callback) 构造一个用户可用于指纹认证的FingerprintManager对象,这个对象用于调用 FIDO BioAuthn指纹认证API。 |
| Return type | Method name |
| int | canAuth() 确定是否可以使用指纹认证。 |
| void | auth(final CryptoObject crypto) 指纹认证的方法。此方法关联一个秘钥或公私钥对,当指纹认证通过后才能使用关联的秘钥或公私钥对。 |
| void | auth() 指纹认证的方法。 |
| void | 取消指纹认证。 |
| Constant |
| public static final int FINGERPRINT_ACQUIRED_GOOD |
值: 0 获得的指纹图像很好。 |
| Constant |
| public static final int FINGERPRINT_ACQUIRED_PARTIAL |
值: 1 仅检测到部分指纹图像。在注册过程中,应告知用户解决该问题需要采取的措施,例如“用力按传感器。” |
| Constant |
| public static final int FINGERPRINT_ACQUIRED_INSUFFICIENT |
值: 2 由于检测到状况(即皮肤干燥)或传感器可能脏污,指纹图像太嘈杂而无法处理(请参阅FINGERPRINT_ACQUIRED_IMAGER_DIRTY)。 |
| Constant |
| public static final int FINGERPRINT_ACQUIRED_IMAGER_DIRTY |
值: 3 由于怀疑或检测到传感器上的污垢,指纹图像太嘈杂。例如,在多次FINGERPRINT_ACQUIRED_INSUFFICIENT或传感器上实际检测到污垢(卡住的像素,条幅等)之后,可以合理地返回此值。退回传感器时,应要求用户采取措施清洁传感器。 |
| Constant |
| public static final int FINGERPRINT_ACQUIRED_TOO_SLOW |
值: 4 指纹图像由于缺乏运动而无法读取。这最适合需要滑动的线性阵列传感器。 |
| Constant |
| public static final int FINGERPRINT_ACQUIRED_TOO_FAST |
值: 5 由于快速运动,指纹图像不完整。虽然最适合于线性阵列传感器,但是如果在采集过程中移动了手指,也会发生这种情况。应该要求用户将手指放慢(线性)移动或将手指放在传感器上的时间更长。 |
| Constant |
| public static final int FACE_ACQUIRED_VENDOR:1038 |
调用auth接口时通过回调对象BioAuthnCallback的onAuthHelp方法的helpCode参数返回值: 1038 检测到指纹。 |
| Constant |
| public static final int FACE_ACQUIRED_VENDOR:1012 |
调用auth接口时通过回调对象BioAuthnCallback的onAuthHelp方法的helpCode参数返回值: 1012 指纹不匹配。 |
| Constant |
| public static final int FINGERPRINT_SUCCESS |
值: 0 如果当前可以使用指纹(已注册且可用)。 |
| Constant |
| public static final int FINGERPRINT_ERROR_HW_UNAVAILABLE |
值: 1 硬件不可用。 |
| Constant |
| public static final int FINGERPRINT_ERROR_UNABLE_TO_PROCESS |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 2 当传感器无法处理当前指纹图像时返回错误状态。 |
| Constant |
| public static final int FINGERPRINT_ERROR_TIMEOUT |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 3 当前请求运行太久时返回错误状态。这是为了防止程序无限期地等待指纹传感器。超时是特定于平台和传感器的,但通常为30秒。 |
| Constant |
| public static final int FINGERPRINT_ERROR_NO_SPACE |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 4 为注册等操作返回错误状态;操作无法完成,因为没有足够的存储空间来完成该操作。 |
| Constant |
| public static final int FINGERPRINT_ERROR_CANCELED |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 5 由于指纹认证传感器不可用,操作被取消。 |
| Constant |
| public static final int FINGERPRINT_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 FINGERPRINT_ERROR_LOCKOUT_PERMANENT |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 9 操作被取消,因为错误锁定发生的次数太多。在用户使用强认证(PIN/Pattern/Password)解锁之前,指纹认证将被禁用。 |
| Constant |
| public static final int FINGERPRINT_ERROR_USER_CANCELED |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 10 用户取消了操作。收到此消息后,应用程序应使用备用认证(例如密码)。应用程序还应提供返回指纹认证的方法,如“使用”按钮。 |
| Constant |
| public static final int FINGERPRINT_ERROR_NO_FINGERPRINTS |
值: 11 用户没有注册任何指纹。 |
| Constant |
| public static final int FINGERPRINT_ERROR_NO_HARDWARE |
canAuth接口返回值: 12 没有指纹认证硬件。 |
| Constant |
| public static final int FINGERPRINT_ERROR_SYS_INTEGRITY_FAILED |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 1001 系统完整性检查失败,比如设备已root,或系统被破坏。 |
| Constant |
| public static final int FINGERPRINT_ERROR_CRYPTO_VERIFY_FAILED |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 1002 使用密钥加密验证认证结果失败。 |
| Constant |
| public static final int FINGERPRINT_ERROR_HMS_FRAMEWORK_ERROR |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 1003 华为移动服务框架错误。 |
| Constant |
| public static final int FINGERPRINT_ERROR_UNSUPPORTED_OS_VER |
调用auth接口时通过回调对象BioAuthnCallback的onAuthError方法的errorCode参数返回值: 1004 操作系统版本不支持指纹认证。支持FIDO BioAuthn指纹认证的设备需满足 Android 版本 >=6.0。 |
| Method |
| public FingerprintManager(android.app.FragmentActivity activity, java.util.concurrent.Executor executor, BioAuthnCallback callback) |
Parameters
| Parameter name | Parameter desc |
| activity | 安卓应用的Activity,对客户端的activity的引用。 |
| executor | 处理回调事件的执行器。 |
| callback | 用于处理认证事件的回调对象。 |
| Method |
| public FingerprintManager(android.app.Fragment fragment, java.util.concurrent.Executor executor, BioAuthnCallback callback) |
Parameters
| Parameter name | Parameter desc |
| fragment | 安卓应用的 Fragment,对客户端的fragment的引用。 |
| executor | 处理回调事件的执行器。 |
| callback | 用于处理认证事件的回调对象。 |
| Method |
| public int canAuth() |
| 确定是否可以使用指纹认证。 |
Return
| type | desc |
| int | FINGERPRINT_SUCCESS 如果当前可以使用指纹认证(已注册且可用)。 FINGERPRINT_ERROR_HW_UNAVAILABLE 如果硬件不可用。 FINGERPRINT_ERROR_NO_FINGERPRINTS 如果用户没有注册任何指纹。 FINGERPRINT_ERROR_NO_HARDWARE 如果没有指纹认证硬件。 FINGERPRINT_ERROR_UNSUPPORTED_OS_VER 操作系统版本不支持指纹认证。 |
| Method |
| public void auth(final CryptoObject crypto) |
| 指纹认证的方法。此方法关联一个秘钥或公私钥对,当指纹认证通过后才能使用关联的秘钥或公私钥对。 |
Parameters
| Parameter name | Parameter desc |
| crypto | 与指纹认证关联的加密对象。 |
| Method |
| public void auth() |
| 指纹认证的方法。 |
| Method |
| public void cancelAuth() |
| 取消展示指纹认证提示窗口。 |