Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the applicationProtectedDataWillBecomeUnavailable: application delegate method also apply to the keychain?

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!

like image 212
Daniel Avatar asked Oct 29 '25 18:10

Daniel


1 Answers

To answer my own question: as far as I can tell, yes, the applicationProtectedDataWillBecomeUnavailable and applicationProtectedDataDidBecomeAvailable 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.

like image 117
Daniel Avatar answered Oct 31 '25 08:10

Daniel