Global Variable

kSecAttrAccessibleWhenUnlocked

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

Declaration

let kSecAttrAccessibleWhenUnlocked: CFString

Discussion

This is recommended for items that need to be accessible only while the application is in the foreground. Items with this attribute migrate to a new device when using encrypted backups.

This is the default value for keychain items added without explicitly setting an accessibility constant.

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 kSecAttrAccessibleWhenUnlockedThisDeviceOnly: 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.

let kSecAttrAccessibleAlways: CFString

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