在iOS中打开和存储加密的文档离线 [英] Opening and storing encrypted documents offline in iOS
问题描述
我已经下载了加密文件,可以在文件夹中查看离线视图,我想知道:
I have encrypted files downloaded and available for offline view in a folder, I would like to know:
-
如何在相应的读者中打开它们,因为这些是ms office文档和prezi格式
how to open them in the appropriate reader as these are ms office docs and prezi format
我想他们必须不加密,以便读者可以阅读它们,但在这案例如何确保安全?
I suppose they will have to be unencrypted so that reader can read them but in this case how to ensure security?
使用哪个文件夹来避免iCloud同步,我已经阅读了这个禁用iCloud同步
which folder to use to avoid iCloud sync, I already read this Disable iCloud sync
iOS是否通过基于应用程序键的加密来保护应用程序的文档我读了,还是我错了?
Does iOS protects documents of the application by encryption based on app key as I read it or am I wrong?
推荐答案
发生,Sven是正确的关于 UIDocumentInteractionController
,该对象由URL标识。
Speaking extemporaneously, as thoughts occur, Sven is right about UIDocumentInteractionController
and that objects are identified by URL.
但是, t需要在磁盘上解压缩您的文件才能使其工作。你可以编写自己的小URL协议(子类 NSURLProtocol
,并适当地实施方法;您应该最终检查URL是否在您创建的发明方案内 - 例如 myApplicationEncrypted://
- 然后将数据包发布到 NSURLProtocolClient
),并通过< a href =https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLProtocol_Class/Reference/Reference.html#//apple_ref/occ/clm/NSURLProtocol/registerClass%3a rel =nofollow> NSURLProtocol + registerClass
。
However, it's possible you don't need to unencrypt your files on disk for this to work. You can probably write your own little URL protocol (subclass NSURLProtocol
and implement methods appropriately; you should end up checking that URLs are within the invented scheme you've created — e.g. myApplicationEncrypted://
— then posting data packets to a NSURLProtocolClient
) and register it with the device via NSURLProtocol +registerClass
.
您显然需要在磁盘和协议客户端之间进行解密。所以你会传递未加密的数据 - 你需要对 UIDocumentInteractionController
进行信任判断。
You'll obviously need to decrypt between disk and protocol client. So you'll be passing unencrypted data on — you'll need to make a trust judgment on UIDocumentInteractionController
.
文档交互控制器被记录在您的应用程序中,因此不应该出现沙箱问题。
The document interaction controller is documented to work within your app, so there shouldn't be sandbox concerns.
这篇关于在iOS中打开和存储加密的文档离线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!