Global Variable

kSecAttrAccessibleWhenUnlockedThisDeviceOnly

The data in the keychain item can be accessed only while the device is unlocked by the user.

Declaration

let kSecAttrAccessibleWhenUnlockedThisDeviceOnly: CFString

Discussion

This is recommended for items that need to be accessible only while the application is in the foreground. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present.

See Also

Accessibility Values

let kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly: CFString

The data in the keychain can only be accessed when the device is unlocked. Only available if a passcode is set on the device.

let kSecAttrAccessibleWhenUnlocked: CFString

The data in the keychain item can be accessed only while the device is unlocked by the user.

let kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly: CFString

The data in the keychain item cannot be accessed after a restart until the device has been unlocked once by the user.

let kSecAttrAccessibleAfterFirstUnlock: CFString

The data in the keychain item cannot be accessed after a restart until the device has been unlocked once by the user.

let kSecAttrAccessibleAlwaysThisDeviceOnly: CFString

The data in the keychain item can always be accessed regardless of whether the device is locked.

Deprecated
let kSecAttrAccessibleAlways: CFString

The data in the keychain item can always be accessed regardless of whether the device is locked.

Deprecated

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software