赞
踩
BiometricAuthentication biometricAuthentication = BiometricAuthentication.getInstance(MainAbility.mAbility);
复制
2D人脸识别建议使用SECURE_LEVEL_S2,3D人脸识别建议使用SECURE_LEVEL_S3。代码示例如下:
int retChkAuthAvb = biometricAuthentication.checkAuthenticationAvailability(
BiometricAuthentication.AuthType.AUTH_TYPE_BIOMETRIC_FACE_ONLY,
BiometricAuthentication.SecureLevel.SECURE_LEVEL_S2, true);
复制
// 定义一个Signature对象sign;
biometricAuthentication.setSecureObjectSignature(sign);
// 定义一个Cipher对象cipher;
biometricAuthentication.setSecureObjectCipher(cipher);
// 定义一个Mac对象mac;
biometricAuthentication.setSecureObjectMac(mac);
复制
new Thread(new Runnable() {
@Override
public void run() {
int retExcAuthretExcAuth = biometricAuthentication.execAuthenticationAction(
BiometricAuthentication.AuthType.AUTH_TYPE_BIOMETRIC_FACE_ONLY,
BiometricAuthentication.SecureLevel.SECURE_LEVEL_S2, true, false, null);
}
}).start();
复制
AuthenticationTips tips = biometricAuthentication.getAuthenticationTips();
复制
Signature sign = biometricAuthentication.getSecureObjectSignature();
Cipher cipher = biometricAuthentication.getSecureObjectCipher();
Mac mac = biometricAuthentication.getSecureObjectMac();
复制
int ret = biometricAuthentication.cancelAuthenticationAction();
最后,为了能让大家更好的去学习提升鸿蒙 (Harmony OS) 开发技术,小编连夜整理了一份30个G纯血版学习资料(含视频、电子书、学习文档等)以及一份在Github上持续爆火霸榜的《纯血版华为鸿蒙 (Harmony OS)开发手册》(共计890页),希望对大家有所帮助。
需要以上视频学习资料小伙伴
这份手册涵盖了当前鸿蒙 (Harmony OS) 开发技术必掌握的核心知识点
HarmonyOS 概念:
如何快速入门?
开发基础知识:
基于ArkTS 开发:
获取以上文中提到的这份纯血版鸿蒙 (Harmony OS) 开发资料的小伙伴
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。