Keychain values preserved even when using ksecattraccessibleafterfirstunlockthisdeviceonly

Hello,

I’m storing some values in the Keychain with the attribute ‘ksecattraccessibleafterfirstunlockthisdeviceonly’ (https://developer.apple.com/documentation/security/ksecattraccessibleafterfirstunlockthisdeviceonly).

When I migrate user data between iPhones via iCloud, this behaves as expected and the keys are not preserved.

However, when I migrate using a direct connection between two devices, the keys are preserved, which seems to contradict the attribute’s intent.

Is this a known behavior, and if so, is there a workaround?

I also find that surprising. I’m gonna do some research and get back to you about this.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Keychain values preserved even when using ksecattraccessibleafterfirstunlockthisdeviceonly
 
 
Q