Post

Replies

Boosts

Views

Activity

Reply to Keychain private key signing error
I am facing the issue not specify to any iOS version but could see from iOS 13 . This is the minimum OS version that we have for the app. These are some different errors that we got for few users during signing the data using private key . Remote alert invalidated -4 UI canceled by system -4 unable to sign digest -3 Canceled by another authentication -4 Caller is not running foreground -1004 Caller moved to background -4 No identities are enrolled  -7 User has denied the use of biometry for this app -1018 Application retry limit exceeded -1 Face ID interlocked -8 Biometry lost -4 match failed -1 // To get signed data using private key - (NSData *)getSignatureUsingPrivateKey:(NSString *)keyNames data:(NSData *)data { SecKeyRef privateKeyReferences = [self getPrivateKeyRef:keyNames]; if(!privateKeyReferences) { NSLog(@"Error retrieving private key"); return nil; } NSError *error; NSData *signature = CFBridgingRelease(SecKeyCreateSignature(privateKeyReferences, kSecKeyAlgorithmECDSASignatureMessageX962SHA256, (CFDataRef) data, (void *)&error)); if(!signature) { NSString *errorMessage = [NSString stringWithFormat:@"Error during signing %@.", error]; NSLog(@"%@", errorMessage); return nil; } return signature; }
Feb ’24