This can happen on iOS and MacOS devices when the Keychain gets screwed up. I did not find a specific scenario how this can be reproduced. The workaround is to go into the Preferences Screen and select “Clear Biometric Storage” from the overflow menu in the app bar.
To get more details about the error you can look at the console log. It should contain something like:
AppleKeyStore: operation failed (pid: 92 sel: 43 ret: e007c007 '-536363001')
The response from Apple Support was:
AppleKeyStore (AKS) is a kernel component that wrangles keys, including keys protected by the Secure Enclave (as are all Face ID keys). This error corresponds to “bad device key”, but that doesn’t tell us much. Somehow the device has got itself into a state where AKS is unable to unwrap a key, and it’s not at all clear how.
I’ve seen this problem before. It seems to crop up very rarely on user devices. AFAIK it has nothing to do with your code. Indeed, we have bugs on file for these symptoms that don’t involve any third-party code at all.
There’s two things you can do here:
- You should file a bug about this, making sure to attached the sysdiagnose log.
It’s possible, although I admit that this possibility is unlikely, that the AKS team will be able to learn more about this problem from this log.
Please send me your bug number so that I can associate it with this incident.
- On the workaround front, this is something I mentioned to earlier: The problem only seems to affect existing keys, so if you you delete and re-create the key you should be all set.
So for now please try the workaround by clearing the keychain. If you encounter this error another way feel free to comment below.