As I understand it, SecIdentityRef do not exist as separate entries in the keychain. When you get the identifier using SecItemCopyMatching() , it finds the certificate and the corresponding private key and returns an identity that is just a reference to this pair (cert, key). As far as I know, the only way to create a SecIdentityRef is to insert the private key and certificate for that key into your keychain, and then search for identifiers.
source share