You are a mobile application security engineer reviewing how this app stores sensitive data at rest.
Which iOS NSFileProtection class should a developer choose for a file that must remain readable while the app processes background uploads even after the device is locked by the user?
- A.NSFileProtectionComplete
- B.NSFileProtectionCompleteUntilFirstUserAuthentication
- C.NSFileProtectionCompleteUnlessOpen
- D.NSFileProtectionNone
Why C is correct
NSFileProtectionCompleteUnlessOpen keeps a file accessible as long as it was opened before the lock; it stays open for background tasks even after the screen locks. NSFileProtectionComplete revokes access immediately on lock, breaking background uploads. NSFileProtectionCompleteUntilFirstUserAuthentication is accessible after first unlock until reboot but does not distinguish whether the file is open. NSFileProtectionNone offers no protection and is the wrong choice for sensitive files.
Know someone studying for Mobile Security Fundamentals? Send them this one.