注意事项:

1.》On iPhone, Keychain rights depend on the provisioning profile used to sign your application.Be sure to consistently use the same provisioning profile across different versions of your application

在iphone中,keychain依靠的是注册应用程序时候的证书。所以需要确保不同的应用程序版本使用相同的证书。

2.》In iOS Keychain Services,certificates, keys, and identities are stored and retrieved in exactly the same way as passwords, except that they have different attributes.

3.》If the password is not on the keychain, then SecItemCopyMatching returns the errSecItemNotFound result code In this case as well, the application displays a dialog to request the user name and password. (This dialog should also include a Cancel button, but that choice was omitted from the figure to keep the flowchart from becoming overly complex.)

4.》If the user selects No, then the routine is finished. If the user selects Yes, then the application calls the SecItemAdd function (if this is a new keychain item) or the SecItemUpdate function (to update an existing keychain item) before ending the routine.

1,为你的应用程序添加keychain服务

SecItemAdd to add an item to a keychain                      使用SecItemAdd添加一个项
SecItemUpdate to modify an existing keychain item                 使用SecItemUpdate来更新现有的项
SecItemCopyMatching to find a keychain item and extract information from it    使用SecItemCopyMatching来查找一个项,使用这个方法后不会弹出提醒让用户允许访问keychain的提醒

SecItemCopyMatching function to find a keychain item owned by your application.In this case there's only one keychain and the user is never prompted to unlock it.

ios 使用keychain来存储token的更多相关文章

  1. IOS 用keychain(钥匙串)保存用户名和密码

    IOS系统中,获取设备唯一标识的方法有很多: 一.UDID(Unique Device Identifier) UDID的全称是Unique Device Identifier,顾名思义,它就是苹果I ...

  2. iOS 使用Keychain 保存 用户名和密码到 本地

    iOS 使用Keychain 保存 用户名和密码到 本地 之前曾把一些简单的数据保存在了plist,文件,及NsuserDefault里面, 但是如果要保存密码之类的,保存在本地就很不安全了: 但是利 ...

  3. iOS运用keychain 把identifierForVendor当成唯一标识。替换advertisingIdentifier

    iOS运用keychain 结合[[[UIDevice currentDevice] identifierForVendor] UUIDString] 取得设备唯一标识 NSString *ident ...

  4. 李洪强iOS开发之数据存储

    李洪强iOS开发之数据存储 iOS应用数据存储的常用方式 1.lXML属性列表(plist)归档 2.lPreference(偏好设置) 3.lNSKeyedArchiver归档(NSCoding) ...

  5. redis存储token

    redis存储token 欢迎关注博主公众号「Java大师」, 专注于分享Java领域干货文章http://www.javaman.cn/sb2/redis-token 在实际开发中,token需要保 ...

  6. iOS使用keychain存储密码

    iOS设备中的Keychain是一个安全的存储容器.通常情况下,可以用NSUserDefaults存储数据信息,但是对于一些私密信息,比如账号.密码等等,就需要使用更为安全的keychain了.苹果自 ...

  7. iOS 之keychain详解(附有Demo)

    iOS keychain是苹果用来保存用户私密数据的一个专业的SQLite数据库.保存的数据主要是一些轻量级的私密数据,比如用户密码,token(令牌)等,保存在这个数据库中的密码不会因为你卸载了ap ...

  8. iOS 关于本地持久化存储的探讨

    目前,用以本地化存储的方式有很多,常用的有以下: 1.临时缓存 先说说临时缓存,临时缓存一般相当于用来管理应用程序中全局需要常用的一些内容.比如当前用户的ID或者当前的定位信息等. 常用的方式就是写一 ...

  9. ios中常见数据存储方式以及SQLite常用的语句

    在iOS中,根据不同的需求对应的有多种数据存储方式: 1.NSUserdefaults  将数据存储到沙盒中(library),方便易用,但是只能存储系统提供的数据类型(plist),不能存储自定义的 ...

随机推荐

  1. js事件(事件冒泡与事件捕获)

    事件冒泡和事件捕获分别由微软和网景公司提出,这两个概念都是为了解决页面中事件流(事件发生顺序)的问题. <div id='aa' click='po'> <p id='bb' cli ...

  2. LeetCode01--回文数

    ''' 判断一个整数是否是回文数.回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数. 示例 1: 输入: 121 输出: true 示例 2: 输入: -121 输出: false 解释: ...

  3. 创建安卓模拟器的两种方式及常用Android命令介绍

    创建安卓模拟器有以下两种方式: 1>通过图形界面创建,在Eclipse中单击Windows->Android Virtual Device Manager启动图形界面窗口 2>如果用 ...

  4. python基础——9(迭代器、生成器)

    一.迭代器 1.概念 器:包含了多个值的容器 迭代:循环反馈(一次从容器中取出一个值) 迭代器:从装有多个值的容器中一次取出一个值给外界 s = 'abcdef' ls = [1,2,3,4,5] 遍 ...

  5. python基础学习笔记——初识函数

    什么是函数 我们目前为止,已经可以完成一些软件的基本功能了,那么我们来完成这样一个功能:约x 1 2 3 4 5 pint("拿出手机") print("打开陌陌&quo ...

  6. 网址导航[IT]

    一.Linux/UNIX Linux公社:http://www.linuxidc.com/index.htm Linux命令大全:http://man.linuxde.net 伯乐在线:http:// ...

  7. django 常见过滤器

      一.形式:小写 {{ name | lower }} 二.过滤器是可以嵌套的,字符串经过三个过滤器,第一个过滤器转换为小写,第二个过滤器输出首字母,第三个过滤器将首字母转换成大写 标签 {{ st ...

  8. Knockout v3.4.0 中文版教程-9-计算监控-API参考

    5.参考 下面的内容描述了如何构建和使用计算监控. 1. 构建一个计算监控 可以用如下的形式构建一个计算监控: ko.computed( evaluator [, targetObject, opti ...

  9. [转]构建Python+Selenium2自动化测试环境(二)

    构建Python+Selenium2自动化测试环境完成之后,就需要测试支持python的selenium的版本是否都支持在不同浏览器上运行,当前我们分别在三个最通用的浏览器上通过脚本来测试. 1.在I ...

  10. 一款基于jQuery的QQ表情插件

    我们在QQ聊天或者发表评论.微博时,会有一个允许加入表情的功能,点击表情按钮,会弹出一系列表情小图片,选中某个表情图片即可发表的丰富的含表情的内容.今天和大家分享一款基于jQuery的QQ表情插件,您 ...