KeychainAccess

public enum KeychainAccess

Access restrictions set when writing values to the keychain that are required to read those values.

  • With this access the data in the keychain item can be accessed only while the device is unlocked by the user.

    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.

    Declaration

    Swift

    case whenUnlockedThisDevice
  • With this access the data in the keychain can only be accessed when the device is unlocked. Only available if a passcode is set on the device.

    This is recommended for items that only need to be accessible while the application is in the foreground. Items with this attribute never migrate to a new device. After a backup is restored to a new device, these items are missing. No items can be stored in this class on devices without a passcode. Disabling the device passcode causes all items in this class to be deleted.

    Declaration

    Swift

    case whenPasscodeSetThisDevice