---
title: kSecAttrAccessible
framework: security
role: symbol
role_heading: Global Variable
path: security/ksecattraccessible
---

# kSecAttrAccessible

A key with a value that indicates when the keychain item is accessible.

## Declaration

```swift
let kSecAttrAccessible: CFString
```

## Mentioned in

Restricting keychain item accessibility

## Discussion

Discussion The corresponding value, one of those found in Accessibility Values, indicates when your app needs access to the data in a keychain item. Choose the most restrictive option that meets your app’s needs so that the system can protect that item to the greatest extent possible. For more information, see Restricting keychain item accessibility. important: You can use this attribute for macOS keychain items only if you also set a value of true for the kSecUseDataProtectionKeychain key, the kSecAttrSynchronizable key, or both. For any item marked as synchronizable, the value for the kSecAttrAccessible key may only be one whose name does not end with ThisDeviceOnly, as those cannot sync to another device. note: The app must provide the contents of the keychain item (kSecValueData) when changing this attribute in iOS 4 and earlier.
