Question about Data Protection entitlement.

Discussion in 'iOS Programming' started by chrono1081, Jun 3, 2015.

  1. chrono1081 macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #1
    Hi guys,

    I've been digging through documentation and can't find a consistent answer to a seemingly simple question:

    Does enabling Data Protection in the Capabilities section of my Xcode project automatically encrypt files in the documents directory when the device is locked?

    I see some places say yes, other places say you need to declare an NSFileManager, and other places say NSFileManager is only if you need to encrypt certain files and for those who want all files encrypted, enabling the Data Protection entitlement under Capabilities is all you need to do, no tagging of files necessary.

    I was hoping someone can clear this up for me.
     
  2. KoolStar macrumors demi-god

    KoolStar

    Joined:
    Oct 16, 2006
    Location:
    Kentucky
    #2
    If you have it enabled for complete protection all files in the documents directory will be encrypted when the device is locked. You can use the NSFileManager to write new files that have different protection levels than the default.

    Here is a good article at: http://angelovillegas.com/2014/06/08/ios-data-protection/
     
  3. chrono1081 thread starter macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #3
    Thank you so much! I was going nuts trying to find the answer.
     

Share This Page