I found an issue. The problem was due to the limitations of the simulator. As soon as I run the app on my mobile phone, everything started to work
PS: The code above will produce double FaceID check :)
That's the correct version in the end:
func generatePrivateKey() -> SecKey? {
// 1. Create Keys Access Control
guard let accessControl =
SecAccessControlCreateWithFlags(
nil,
kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
[.privateKeyUsage, .biometryCurrentSet],
nil)
else {
fatalError("cannot set access control")
}
Topic:
Privacy & Security
SubTopic:
General
Tags: