android phone 的指纹 API
Fingerprint API for android phone
我不熟悉智能手机中的指纹验证。众所周知,三星 S5 目前支持指纹扫描仪。是否可以开发一个可以使用扫描仪来验证用户身份的自定义应用程序?我只需要知道用户的身份以及他是否已通过正确的身份验证。然后我的应用程序可以从那里获取它并与后端集成。
三星提供 Pass API 来注册、请求和验证指纹。它在这里 SAMSUNG FINGER PRINT API。也有一个示例程序。
Google 现在宣布了 Android 的通用指纹 API,任何自定义应用程序都可以使用它进行授权,而不仅仅是本机 Google 应用程序。看来前途越来越光明了!
摘自下面链接的 Android 开发者页面:
"To authenticate users via fingerprint scan, get an instance of the new FingerprintManager
class and call the authenticate()
method."
但是您还必须包含此权限:
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
如果您想了解更多信息,请访问此 URL 并向下滚动至 Authentication
:
https://developer.android.com/about/versions/marshmallow/android-6.0.html#fingerprint-authentication
指纹 API 预览 Android M 被发现 here with Sample App. As of this writing, Android Compatibility Definition for Android M hasn't been published. So, if fingerprint sensor, the key hardware component of the fingerprint framework, is left as a "SHOULD" requirement (most likely to be true), then OEMs decide either to incorporate the sensor or not. But, since Android Pay 与指纹框架密切相关,这可能会促使 OEM 包括指纹传感器。
我找到了 this in google samples,它演示了如何在您的应用程序中使用已注册的指纹来验证用户,然后再进行一些操作(例如购买商品)。
First you need to create a symmetric key in the Android Key Store using KeyGenerator which can be only be used after the user has authenticated with fingerprint and pass a KeyGenParameterSpec.
By setting KeyGenParameterSpec.Builder.setUserAuthenticationRequired
to true, you can permit the use of the key only after the user
authenticate it including when authenticated with the user's
fingerprint.
Then start listening to a fingerprint on the fingerprint sensor by
calling FingerprintManager.authenticate with a Cipher initialized with
the symmetric key created. Or alternatively you can fall back to
server-side verified password as an authenticator.
Once the fingerprint (or password) is verified, the
FingerprintManager.AuthenticationCallback#onAuthenticationSucceeded()
callback is called.
需要SDK V23。据我所知,它对三星 S5 没有用,但它可能会帮助其他人使用此功能。
我不熟悉智能手机中的指纹验证。众所周知,三星 S5 目前支持指纹扫描仪。是否可以开发一个可以使用扫描仪来验证用户身份的自定义应用程序?我只需要知道用户的身份以及他是否已通过正确的身份验证。然后我的应用程序可以从那里获取它并与后端集成。
三星提供 Pass API 来注册、请求和验证指纹。它在这里 SAMSUNG FINGER PRINT API。也有一个示例程序。
Google 现在宣布了 Android 的通用指纹 API,任何自定义应用程序都可以使用它进行授权,而不仅仅是本机 Google 应用程序。看来前途越来越光明了!
摘自下面链接的 Android 开发者页面:
"To authenticate users via fingerprint scan, get an instance of the new FingerprintManager
class and call the authenticate()
method."
但是您还必须包含此权限:
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
如果您想了解更多信息,请访问此 URL 并向下滚动至 Authentication
:
https://developer.android.com/about/versions/marshmallow/android-6.0.html#fingerprint-authentication
指纹 API 预览 Android M 被发现 here with Sample App. As of this writing, Android Compatibility Definition for Android M hasn't been published. So, if fingerprint sensor, the key hardware component of the fingerprint framework, is left as a "SHOULD" requirement (most likely to be true), then OEMs decide either to incorporate the sensor or not. But, since Android Pay 与指纹框架密切相关,这可能会促使 OEM 包括指纹传感器。
我找到了 this in google samples,它演示了如何在您的应用程序中使用已注册的指纹来验证用户,然后再进行一些操作(例如购买商品)。
First you need to create a symmetric key in the Android Key Store using KeyGenerator which can be only be used after the user has authenticated with fingerprint and pass a KeyGenParameterSpec.
By setting KeyGenParameterSpec.Builder.setUserAuthenticationRequired to true, you can permit the use of the key only after the user authenticate it including when authenticated with the user's fingerprint.
Then start listening to a fingerprint on the fingerprint sensor by calling FingerprintManager.authenticate with a Cipher initialized with the symmetric key created. Or alternatively you can fall back to server-side verified password as an authenticator.
Once the fingerprint (or password) is verified, the FingerprintManager.AuthenticationCallback#onAuthenticationSucceeded() callback is called.
需要SDK V23。据我所知,它对三星 S5 没有用,但它可能会帮助其他人使用此功能。