1

I'm trying to import a public key from my python server into an iOS keychain. I receive the key from my server as an NSData object.

I'm using the addPeerPublicKey:keyBits: function from Apple's Crypto example to convert the NSData into a SecKeyRef, which is how I need to reference it. The function is failing to store the key in the keychain and I'm not sure why. (SecItemAdd() returns 0=success but getKeyRefWithPersistentKeyRef: returns null).

I'm using PyCrypto on my server to generate the RSA keys and exporting them to my client in DER format. Is there anything else I need to do to convert the format to make it storable in the Apple keychain?

Dash
  • 17,188
  • 6
  • 48
  • 49

0 Answers0