<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/kSecAttrProtocol",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@kSecAttrProtocol"
  },
  "title" : "kSecAttrProtocol"
}
-->

# kSecAttrProtocol

A key whose value indicates the item’s protocol.

```
let kSecAttrProtocol: CFString
```

## Discussion

The corresponding value is of type <doc://com.apple.documentation/documentation/CoreFoundation/CFString> and denotes the protocol for this item (see [Protocol Values](/documentation/Security/item-attribute-keys-and-values#Protocol-Values)). Items of class [`kSecClassInternetPassword`](/documentation/Security/kSecClassInternetPassword) have this attribute.

> Note:
> For compatibility with earlier Keychain APIs, functions in <doc://com.apple.security/documentation/Security/keychain-services> accept a <doc://com.apple.documentation/documentation/CoreFoundation/CFNumber> for the protocol. The number is a 32-bit integer that encodes the protocol value as a `FourCharCode`. In your code, use a <doc://com.apple.documentation/documentation/CoreFoundation/CFString> with one of the values from <doc://com.apple.security/documentation/Security/item-attribute-keys-and-values#Protocol-Values> instead of a number.

---

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)