errSecInteractionNotAllowed with -25308 and device lock

Hi all,


Im doing a device passcode check using the keychain kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, this way I can check if the device has a passcode or not by trying to add an item to the keychain and look at the status response.

The only issue I have is that this option is only valid for check if the device is unlocked at the time of checking. At this time I receive the 25308 error.

My question is: can I trust that this 25308 error will be received only when the device is locked and with passcode? Are there any options to receive this error when the device is not locked with passcode?

This way I can use both statuses: errSecSuccess or errSecInteractionNotAllowed in order to decide that the device is passlocked.


Thanks.

errSecInteractionNotAllowed with -25308 and device lock
 
 
Q