I've tagged the thread "macOS", which I hope is the correct way to indicate these things.
I'm not specifying the data protection keychain (though I know it's possible with a query dictionary). These keys could be provided from any source to this code, which is part of the issue. Is there a good way to check if a SecKey in-hand came from a particular source? Given the risk of an operation on an item becoming trapped in user authentication (if running in a context where that is possible), it seems like a good idea to be able to preflight and return an error code early regardless of source, item type, or usage.
If it helps, assume the System keychain is involved here. I didn't realize kSecUseAuthentication* might be data-protection-only.
Topic:
App & System Services
SubTopic:
Core OS
Tags: