title: Data Protection / NSFileProtectionComplete - successfully supported through entitlements.plist?
body: <p>I'm looking to encrypt user data in an app, and the NSFileProtection mechanism looks perfect for this.</p>
  
  <p>This <a href="https://stackoverflow.com/questions/10004299/file-system-encryption-for-ios">SO Question / Answer thread</a> pointed me at the WWDC 2011 Video <a href="https://developer.apple.com/videos/wwdc/2011/?id=208" rel="nofollow noreferrer">Securing iOS Apps</a>  which gave the 'too good to be true' tip of setting Data Protection across the app via entitlements (see from 33 minutes in).</p>
  
  <p>So, I tried this for my iOS 5.x+ app, and ran into the problem where it complains about <a href="https://stackoverflow.com/questions/9359596/the-executable-was-signed-with-invalid-entitlements-0xe8008016">Invalid Entitlements</a>.</p>
  
  <p>I've configured Data Protection for the specific app via the iOS Provisioning Portal, and updated my app Provisioning, so in theory I should all be set, but I still get the error.</p>
  
  <p>If I remove the specific FileProtectionComplete setting from the Entitlement, the app runs without the Invalid Entitlement error.</p>
  
  <p>In investigating this, I also saw the some folk are getting their apps <a href="https://stackoverflow.com/questions/12301161/invalid-code-signing-entitlements-data-protection-key-not-supported?rq=1">rejected</a> (at the point they upload the binary) as this isn't supported (or deprecated?).  Please note that I'm specifically asking about Data Protection, and not Passbook.</p>
  
  <p>At this stage, I'm thinking, maybe it really is, 'too good to be true'. So, I'm about to give up on this magic entitlements flag, and instead use the programmatic method, of adding NSFileProtectionComplete as a write option.</p>
  
  <p>However, before I do that, can anyone confirm they've been able to successfully add Data Protection just by using the Entitlements flag?  Thanks.</p>