什么是新的“iOS 数据保护 API"?

What are the new quot;iOS data protection APIsquot;?(什么是新的“iOS 数据保护 API?)

本文介绍了什么是新的“iOS 数据保护 API"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您在 Google 上搜索iphone 数据保护 API",您会看到基于新闻稿的大量点击.

If you Google "iphone data protection apis" you'll see a zillion hits based on press releases.

如果您查看 http://support.apple.com/kb/HT4175 您可以看到苹果直接做出指示.

If you check out http://support.apple.com/kb/HT4175 you can see Apple making the indication directly.

这些 API 在哪里/是什么?我在 iOS4 之前使用过旧的加密 API,所以它们不是 那些.这些 API 应该为第 3 方应用程序提供 MDM(移动设备管理)类型的功能.

Where are/what are these APIs? I've used the old crypto APIs before iOS4, so they're not those. These APIs are supposed to give MDM (Mobile Device Management)-type capability for 3rd-party apps.

TIA!

推荐答案

在将 NSData 写入磁盘时,您可以设置一些 FileProtection 选项:

There are some FileProtection options you can set when writing an NSData to disk:

  • NSDataWritingFileProtectionComplete
  • NSDataWritingFileProtectionNone)

还有一个扩展属性NSFileProtectionKey,你可以通过NSFileManager设置磁盘上预先存在的文件:

as well as an extended attribute, NSFileProtectionKey, you can set on pre-existing files on disk via NSFileManager:

  • NSFileProtectionComplete
  • NSFileProtectionNone

当您的应用程序能够(不)能够访问受保护的数据时,还会通知应用程序委托:

The app delegate is also informed of when your application is (not) going to be able to access protected data:

  • -applicationProtectedDataDidBecomeAvailable:
  • -applicationProtectedDataWillBecomeUnavailable:

加密和保护数据的所有细节都由硬件和操作系统代表您处理.每当设备锁定时,它就会启动即发即弃保护.

All the gory details of encrypting and securing the data are handled by the hardware and OS on your behalf. It's fire-and-forget protection that kicks in whenever the device locks.

这篇关于什么是新的“iOS 数据保护 API"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:什么是新的“iOS 数据保护 API"?