applicationProtectedDataWillBecomeUnavailable: 应用程序委托方法是否也适用于钥匙串?
我很难找到关于 applicationProtectedDataWillBecomeUnavailable 和 applicationProtectedDataDidBecomeAvailable 实际上正在发出保护信号的明确文档。会话 209 似乎表明委托方法意味着钥匙串和受保护的文件都变得不可用,但文档仅引用文件。
我将我的钥匙串设置为 kSecAttrAccessibleWhenUnlockedThisDeviceOnly ,其中文档表明这意味着钥匙串仅在应用程序位于前台时可用,但后来我让我的应用程序尝试在 applicationDidEnterBackground 委托方法中访问其钥匙串,并且它能够。
那么,有人可以帮我澄清这一点,并启发我如何检测钥匙串何时对我的应用程序变得不可用吗?谢谢!
I'm having a hard time finding clear documentation about what applicationProtectedDataWillBecomeUnavailable and applicationProtectedDataDidBecomeAvailable actually are signaling the protection of. Session 209 seems to suggest that the delegate methods imply that both the keychain and the protected files are becoming unavailable, but the documentation only refers to files.
I have my keychain set to kSecAttrAccessibleWhenUnlockedThisDeviceOnly where the documentation suggests that means the keychain is only available when the application is in the foreground, but then I had my application try to access its keychain in the applicationDidEnterBackground delegate method and it was able to.
So, can someone clarify this for me and enlighten me about how to detect when the keychain is becoming unavailable to my application? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回答我自己的问题:据我所知,是的,
applicationProtectedDataWillBecomeUnavailable
和applicationProtectedDataDidBecomeAvailable
指的是应用程序的钥匙串和受保护文件。我有一个应用程序将数据存储在钥匙串中,此时应用程序开始报告两个委托方法,所以这就是我的假设的基础。
To answer my own question: as far as I can tell, yes, the
applicationProtectedDataWillBecomeUnavailable
andapplicationProtectedDataDidBecomeAvailable
refer to both the keychain and protected files for the application.I have an application that stored data in the keychain at which point the application started reporting the two delegate methods, so that's what I'm basing my assumption on.