苹果在2014年6月3日的WWDC2014开幕式上推出了新版iOS8系统,界面上iOS8与iOS7相比变化不大,只是在功能方面进行了完好。iOS8通知中心更加强大,支持消息直接回复操作,并支持QuickType和第三方输入法。短信功能改进明显,支持群聊。发送语音、视频,分享地理位置等。从终端用户的角度看。iOS8的很多新功能早已出如今其它平台中。iOS8会向第三方软件开放TouchID訪问,这意味着能够使用该感应器登陆银行应用等。

第三方应用能够使用TouchID接口,意味着未来的非常多应用都能够用指纹识别功能了。你能够选择Touch ID登陆第三方应用程序,不须要输入password,你的指纹数据是被保护的,在没有被同意的情况下别的程序是訪问不到它的。

                    

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveXVqaWFueGlhbmc2NjY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" height="165" width="275">

依据苹果的解释,一个单一的注冊指纹与别人指纹出现随机匹配的概率为五万分之中的一个。

苹果声称“Secure Enclave”模块系统可以安全地管理并识别用户的指纹,并将用户的指纹信息独立地保存在别的系统中。同一时候通过加密内存和一个硬件随机数字password发生器进行管理。

每一个“Secure Enclave”是单独设置的。不能訪问系统其它部分的,拥有自己的独立的UID(唯一的ID),连苹果也不知道这些UID。当设备启动时,Touch ID会暂时创建一个秘钥,与“Secure Enclave”的UID配合,对设备的内存空间进行加密。

而在苹果公布的文件里。苹果对A7处理器进行指纹识别授权的描写叙述是:A7和Touch ID之间通过一个串行外设接口总线进行通信。A7处理器将数据发到“Secure Enclave”。但并不正确数据内容进行读取。加密和身份验证都是使用Touch ID和“Secure Enclave”之间的共享密钥。

通信密钥交换使用两方提供的一个随机AES密钥,并随机建立会话密钥和使用AES-CCM传输加密。

据了解:iPhone 5s中的指纹传感器检測到的表皮上突起的纹线。

它检測到的不是用户手指外部的死皮指纹,这样的指纹非常easy被复制。iPhone 5s的指纹传感器利用射频信号。检測用户手指表面下方那一层皮肤的“活”指纹。假设手指与人的身体分离,那么传感器是无法检測到这样的指纹的。所以用户不用操心自己的指纹被复制或盗窃之后,被用于解锁设备,由于传感器是无法识别这样的“死”指纹的。

近期研究了下iOS8的文档,对指纹识别了解了下,并下载了一个官方提供的Demo。可是

NS_CLASS_AVAILABLE(10_10, 8_0)

从这句中能够看出,要想使用TouchID的接口,电脑的mac系统必须是10.10的,手机iOS系统必须是8.0,所以为了这个Demo我也没有升级电脑系统(毕竟还不稳定)。

但依据Demo中的代码和文档能够看出,TouchID的基本使用方法。

1.首先要使用TouchID。要先导入依赖包:LocalAuthentication.framework

2.检查设备能否用TouchID,返回检查结果BOOL类型success:

LAContext *context = [[LAContext alloc] init];
__block NSString *msg;
NSError *error;
BOOL success; // test if we can evaluate the policy, this test will tell us if Touch ID is available and enrolled
success = [context canEvaluatePolicy: LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error];
if (success) {
msg =[NSString stringWithFormat:NSLocalizedString(@"TOUCH_ID_IS_AVAILABLE", nil)];
} else {
msg =[NSString stringWithFormat:NSLocalizedString(@"TOUCH_ID_IS_NOT_AVAILABLE", nil)];
}

3.假设设备能使用TouchID。代码块中返回识别结果BOOL类型的success:

LAContext *context = [[LAContext alloc] init];
__block NSString *msg; // show the authentication UI with our reason string
[context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:NSLocalizedString(@"UNLOCK_ACCESS_TO_LOCKED_FATURE", nil) reply:
^(BOOL success, NSError *authenticationError) {
if (success) {
msg =[NSString stringWithFormat:NSLocalizedString(@"EVALUATE_POLICY_SUCCESS", nil)];
} else {
msg = [NSString stringWithFormat:NSLocalizedString(@"EVALUATE_POLICY_WITH_ERROR", nil), authenticationError.localizedDescription];
}
}];

4.对于检查和识别的两个方法在 LocalAuthentication.framework/Headers/LAContext.h 中定义的:

/// Determines if a particular policy can be evaluated.
///
/// @discussion Policies can have certain requirements which, when not satisfied, would always cause
/// the policy evaluation to fail. Examples can be a passcode set or a fingerprint
/// enrolled with Touch ID. This method allows easy checking for such conditions.
///
/// Applications should consume the returned value immediately and avoid relying on it
/// for an extensive period of time. At least, it is guaranteed to stay valid until the
/// application enters background.
///
/// @warning Do not call this method in the reply block of evaluatePolicy:reply: because it could
/// lead to a deadlock.
///
/// @param policy Policy for which the preflight check should be run.
///
/// @param error Optional output parameter which is set to nil if the policy can be evaluated, or it
/// contains error information if policy evaluation is not possible.
///
/// @return YES if the policy can be evaluated, NO otherwise.
- (BOOL)canEvaluatePolicy:(LAPolicy)policy error:(NSError * __autoreleasing *)error; /// Evaluates the specified policy.
///
/// @discussion Policy evaluation may involve prompting user for various kinds of interaction
/// or authentication. Actual behavior is dependent on evaluated policy, device type,
/// and can be affected by installed configuration profiles.
///
/// Be sure to keep a strong reference to the context while the evaluation is in progress.
/// Otherwise, an evaluation would be canceled when the context is being deallocated.
///
/// The method does not block. Instead, the caller must provide a reply block to be
/// called asynchronously when evaluation finishes. The block is executed on a private
/// queue internal to the framework in an unspecified threading context. Other than that,
/// no guarantee is made about which queue, thread, or run-loop the block is executed on.
///
/// Implications of successful policy evaluation are policy specific. In general, this
/// operation is not idempotent. Policy evaluation may fail for various reasons, including
/// user cancel, system cancel and others, see LAError codes.
///
/// @param policy Policy to be evaluated.
///
/// @param reply Reply block that is executed when policy evaluation finishes.
///
/// @param localizedReason Application reason for authentication. This string must be provided in correct
/// localization and should be short and clear. It will be eventually displayed in
/// the authentication dialog subtitle. A name of the calling application will be
/// already displayed in title, so it should not be duplicated here.
///
/// @param success Reply parameter that is YES if the policy has been evaluated successfully or NO if
/// the evaluation failed.
///
/// @param error Reply parameter that is nil if the policy has been evaluated successfully, or it contains
/// error information about the evaluation failure.
///
/// @warning localizedReason parameter is mandatory and the call will throw NSInvalidArgumentException if
/// nil or empty string is specified.
///
/// @see LAError
///
/// Typical error codes returned by this call are:
/// @li LAErrorUserFallback if user tapped the fallback button
/// @li LAErrorUserCancel if user has tapped the Cancel button
/// @li LAErrorSystemCancel if some system event interrupted the evaluation (e.g. Home button pressed).
- (void)evaluatePolicy:(LAPolicy)policy localizedReason:(NSString *)localizedReason reply:(void(^)(BOOL success, NSError *error))reply;

欢迎小伙伴们对測试结果检验一下啊!

(转载请注明出处,谢谢!

http://blog.csdn.net/yujianxiang666/article/details/35280025)

iOS8指纹识别TouchID的更多相关文章

  1. ios8指纹识别

    简介 苹果从iPhone5S开始,具有指纹识别技术,从iOS8.0之后苹果允许第三方 App 使用 Touch ID进行身份验证.指纹识别Touch ID提供3+2共5次指纹识别机会(3次识别失败后, ...

  2. iOS 钥匙串 指纹识别 get和Post请求的区别

    01-钥匙串 1. 通过系统提供的钥匙串功能可以在本地保存密码,系统使用AES的方式对密码加密 a. 查看Safari中保存的密码 2. 使用第三方框架SSKeychain把密码保存到钥匙串和获取钥匙 ...

  3. 深夜闲聊节目:华为 Mate7的指纹识别安全么?

    许久没有写过不论什么东西,近期非常忙并且还要准备找工作之类的,唉... ....今天的文章也不说技术,仅仅是闲聊. 一.手机指纹识别一揽 打开非常多站点.论坛的科技栏目,充斥着各种手机讯息!仿佛手机已 ...

  4. iOS - TouchID 指纹识别

    前言 NS_CLASS_AVAILABLE(10_10, 8_0) @interface LAContext : NSObject 指纹识别功能是 iPhone 5s 推出的,SDK 是 iOS 8. ...

  5. 指纹识别人脸识别 iOS

    //1.判断iOS8及以后的版本 if([UIDevice currentDevice].systemVersion.doubleValue >= 8.0){ //从iPhone5S开始,出现指 ...

  6. iOS开发——Touch ID 指纹识别

    项目中为了安全性,一般使用密码或iPhone手机的指纹识别Touch ID. 第一步,判断系统是否支持,iOS8.0及以上才支持. 第二步,判断手机是否支持,带Touch ID的手机iPhone5s及 ...

  7. ios开发-指纹识别

    最近我们使用支付宝怎么软件的时候,发现可以使用指纹了,看起来是否的高大上.当时苹果推出了相关接口,让程序写起来很简单哈. 在iPhone5s的时候,苹果推出了指纹解锁.但是在ios8.0的时候苹果才推 ...

  8. IOS指纹识别调用

    最近正在开发的一个app需要加入指纹识别的功能,先搜索一下找到官方文档,简单易懂: https://developer.apple.com/library/ios/documentation/Loca ...

  9. iOS- Swift:指触即开,如何集成Touch ID指纹识别功能

    1.前言 随着移动支付时代的到来,Touch ID 指纹验证迅速被支付宝,微信钱包普及,相信各位朋友使用后也大呼方便.之前写了篇关于iOS9的3D Touch的集成使用,有朋友在我博客下提到,让我写一 ...

随机推荐

  1. 通过xml生成word文档

    Xml生成word总结 使用xml生成word的基本步骤在<使用xslt转化xml数据形成word文档导出.doc>中说明比较清楚了.但是其中的细节并未说到,因此自己折腾了两天总算成功了. ...

  2. Maven和Eclipse联合开发(转)

    最近公司突然把以前的架构推到从来,这个还真需要勇气,不过也是的,基础不好,再好的房子也站不稳.公司采用Maven作为项目管理,WebService项目框架采用SDHI.(Spring+Dubbo+He ...

  3. Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart

    之前都是命令行创建,今天用eclipse装m2eclipse的时候装完后创建项目的时候报错: Could not resolve archetype org.apache.maven.archetyp ...

  4. C#:总结页面传值几种方法

    小知识点: 1.  W7自带 .NetFrameWork 3.5, 兼容模式为 高版本号兼容低版本号: 2. WF和WPF都是基于XAML的,可是两者的用途不同. WF是一种开发框架,将工作流嵌入在. ...

  5. UITableViewHeaderFooterView的使用+自己主动布局

    UITableViewHeaderFooterView的使用+自己主动布局 使用UITableView的header或footer复用时,假设採用自己主动布局,你会发现有约束冲突,以下这样写能够消除约 ...

  6. 数据备份--dump(此作者有许多有用的博客文章)

    数据中 心操作大量的数据.当遭到破坏时,这就是一场灾难.这时候需要备份来恢复,及时你又大量的备份数据都没用,备份也肯定不是在浪费时间.你也许很幸运从 来没有经历过数据丢失.但是, 由于这种事情极少发生 ...

  7. ASP漏洞+SQL注入的入侵方法

    本文就是想对装上了防火墙的主机,进行入侵攻击的大概思路小结一下. 首先当然是用扫描器对这台服务器(以下简称主机A)进行常规的扫描,得到初步的信息.再用nmap -sS IP -P0 -p 139 ,透 ...

  8. 基于visual Studio2013解决C语言竞赛题之1015日期计算

        题目 解决代码及点评 /* 15. 已知某年不是闰年,给定该年某一天的月份和日期, 求这一天是该年的第几天. */ #include <stdio.h> #incl ...

  9. Android应用公布的准备——渠道注冊与认证

    今天早上申请了一个早上的渠道账号,这工作真是太繁琐,申请的是企业账号,须要营业执照等相关资料,假设申请个人的话预计须要身份证相关信息.以下贴出国内主流的几个渠道.不全然,可是基本上涵盖了大部分. 36 ...

  10. delphi中左右翻转窗体(修改EXStyle)

    unit Unit1; interface uses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Form ...