<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/FileProtectionType",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@T@NSFileProtectionType"
  },
  "title" : "FileProtectionType"
}
-->

# FileProtectionType

Protection level values that can be associated with a file attribute key.

```
struct FileProtectionType
```

## Overview

These values are associated with the [`protectionKey`](/documentation/Foundation/FileAttributeKey/protectionKey) key.

## Topics

### Creating a File Protection Type

[`init(rawValue:)`](/documentation/Foundation/FileProtectionType/init(rawValue:))

Creates a file protection type value.

### Working with Protection Levels

[`complete`](/documentation/Foundation/FileProtectionType/complete)

The file is stored in an encrypted format on disk and cannot be read from or written to while the device is locked or booting.

[`completeUnlessOpen`](/documentation/Foundation/FileProtectionType/completeUnlessOpen)

The file is stored in an encrypted format on disk after it is closed.

[`completeUntilFirstUserAuthentication`](/documentation/Foundation/FileProtectionType/completeUntilFirstUserAuthentication)

The file is stored in an encrypted format on disk and cannot be accessed until after the device has booted.

[`none`](/documentation/Foundation/FileProtectionType/none)

The file has no special protections associated with it.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)