腾讯生物认证平台 TENCENT SOTER
- 授权协议: Apache
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: https://github.com/Tencent/soter
- 软件文档: https://github.com/Tencent/soter/blob/master/README.md
- 官方下载: https://github.com/Tencent/soter
软件介绍
TENCENT SOTER是腾讯于2015年开始制定的生物认证平台与标准,通过与厂商合作,目前已经在一百余款、2.3亿部Android设备上得到支持,并且这个数字还在快速增长。
目前,TENCENT SOTER已经在微信指纹支付、微信公众号/小程序指纹授权接口等场景使用,并得到了验证。
接入TENCENT SOTER,你可以在不获取用户指纹图案的前提下,在Android设备上实现可信的指纹认证,获得与微信指纹支付一致的安全快捷认证体验。
快速接入
可以在几行代码之内快速体验TENCENT SOTER完成指纹授权接口。
在使用之前,请确保所使用的测试机在支持机型列表中。
添加gradle依赖
在项目的build.gradle中,添加TENCENT SOTER依赖
dependencies {
...
compile 'com.tencent.soter:soter-wrapper:1.3.2'
...
}声明权限
在 AndroidManifest.xml中添加使用指纹权限
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
初始化
初始化过程整个应用声明周期内只需要进行一次,用于生成基本配置和检查设备支持情况。你可以选择在Application的onCreate()中,或者在使用TENCENT SOTER之前进行初始化。
InitializeParam param = new InitializeParam.InitializeParamBuilder()
.setScenes(0) // 场景值常量,后续使用该常量进行密钥生成或指纹认证
.build();
SoterWrapperApi.init(context,
new SoterProcessCallback<SoterProcessNoExtResult>() {...},
param);准备密钥
需要在使用指纹认证之前生成相关密钥
SoterWrapperApi.prepareAuthKey(new SoterProcessCallback<SoterProcessKeyPreparationResult>() {...},false, true, 0, null, null);进行指纹认证
密钥生成完毕之后,可以使用封装接口调用指纹传感器进行认证。
AuthenticationParam param = new AuthenticationParam.AuthenticationParamBuilder()
.setScene(0)
.setContext(MainActivity.this)
.setFingerprintCanceller(mSoterFingerprintCanceller)
.setPrefilledChallenge("test challenge")
.setSoterFingerprintStateCallback(new SoterFingerprintStateCallback() {...}).build();
SoterWrapperApi.requestAuthorizeAndSign(new SoterProcessCallback<SoterProcessAuthenticationResult>() {...}, param);释放
当你不再使用TENCENT SOTER时,可以选择释放所有资源,用于停止所有生成、上传任务以及支持状态等。释放之后再次使用时,需要重新进行初始化。 实际上,TENCENT SOTER本身不会占据过多资源,只需要在确认不会再次使用的前提下(如切换账户之前)释放一次即可。
SoterWrapperApi.release();
RESTful Web Services Cookbook
Subbu Allamaraju / Yahoo Press / 2010-3-11 / USD 39.99
While the REST design philosophy has captured the imagination of web and enterprise developers alike, using this approach to develop real web services is no picnic. This cookbook includes more than 10......一起来看看 《RESTful Web Services Cookbook》 这本书的介绍吧!
