I generated a private PKCS#12 key and then put it in PEM format, and sent it over to the iPhone app. I want to save this private key in the iPhone Keychain.
First, I removed the headers like "BEGIN RSA PRIVATE KEY". Then I converted the rest of it into NSData
. Then, using code like this:
CFDictionaryRef issues in Swift
I was able to get a SecKeyRef
from this private key.
Now I want to know how I can insert this SecKeyRef
into the keychain using SecItemAdd
?