SecKeyCreateSignature with LAContext.invalidate

I have some code where I'm using SecKeyCreateSignature using a SecKey that I retrieved using SecCopyItemMatching with an LAContext provided to the query via the kSecUseAuthenticationContext parameter.

This is a biometrically-backed key so a Touch ID prompt is displayed for the user. Calling LAContext.invalidate() while that system prompt is present doesn't dismiss the prompt or cancel the SecKeyCreateSignature call. I was hoping that would behave similar to how calling LAContext.invalidate when calling LAContext.evaluatePolicy and dismiss the system prompt and cancel the evaluatePolicy call.

Is this a bug/oversight, expected behaviour, or am I missing some required setup to accomplish what I'm trying to do?

Replies

I’m not aware of any way to cancel a SecKeyCreateSignature request that’s stuck at a prompt. My advice here is that you file an enhancement request for a supported way to do this.

Please post your bug number, just for the record.

Share and Enjoy

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