Storing certificates in KeyChain (already exists)

Hi,
Our iOS application generate CSR and send it to the server, server then generate client certificate based on CSR and send it back, application then store it in a keychain.
The problem is when we try to store second certificate (different csr), system return us an error saying than this certificate already exists in a keychain which is not true.
So my question is, what iOS compere to decide if one certificate is the same as the other?
Thanks,
Tomasz Trela

So my question is, what iOS compere to decide if one certificate is the same as the other?

The criteria used to determine keychain item uniqueness is documented in the reference docs for

errSecDuplicateItem
. I suspect that your CA is not giving each certificate a unique serial number (
kSecAttrSerialNumber
).

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Sorry I forget to reply,
It was indeed serial number.
Thank you very much! 🙂

Storing certificates in KeyChain (already exists)
 
 
Q