SecKeyCreateSignature Eror (-3)

Hello to the team,

For almost one week we're trying to figure out, why trying to create a signature using SecKeyCreateSignature is working fine when we're using the same whole flow from UIKit and fails (return -3 and not presenting the FaceId view) when we're calling it from UIHostingController, using SwiftUI.

This is the command that fails - the whole flow to this point is the same and is being running on an item that implement the same protocol extension.

let signature = SecKeyCreateSignature(secKey, algorithm, data as CFData, &error) as Data?

Your help will be fully appreciated. Thanks a lot! Dudi

  • error -3 - unable to sign digest

Add a Comment

Replies

Testing it on real device - iPhone 13 pro max - iOS 16.1 - Fails. Testing it on simulator, iPhone 11, iOS 16.0, with Enrolling FaceID - works fine.

It seems that the root cause is the the SecItemCopyMatching is being called and generate a broken result and this is without presenting the FaceID UI. I'm wondering, how we pass this section without presenting the UI on real device?