---
title: kSecAttrProtocol
framework: security
role: symbol
role_heading: Global Variable
path: security/ksecattrprotocol
---

# kSecAttrProtocol

A key whose value indicates the item’s protocol.

## Declaration

```swift
let kSecAttrProtocol: CFString
```

## Mentioned in

Adding a password to the keychain

## Discussion

Discussion The corresponding value is of type CFString and denotes the protocol for this item (see Protocol Values). Items of class kSecClassInternetPassword have this attribute. note: For compatibility with earlier Keychain APIs, functions in Keychain services accept a CFNumber for the protocol. The number is a 32-bit integer that encodes the protocol value as a FourCharCode. In your code, use a CFString with one of the values from Protocol Values instead of a number.
