views:

989

answers:

2

Hello everyone,

I'm trying to add a public and private RSA keys to the iPhone's keychain, so I can use the CommonCrypto library, but am not entirely sure how to do that. The MYCrypto library seems to only work for the Mac and not the iPhone right now. Can anyone help and explain how to add a private/public key to the keychain and get a SecKeyRef to them?

A: 

This appears to be a duplicate of this SO question.

MyCrypto says that it works on the iPhone. What kind of problems are you seeing?

Naaff
No, the limitations for MYCrypto specifically say that it runs into problems at runtime with the iPhone. I get an OSStatus parameter error (-50) when I try to import the public key.
Yeah, Jens Alfke is working hard on it but it's pretty clear from his correspondence on the CDSA mailing list that he's cracking a *very tough nut* and it's going to be a while before he's got a readily-consumable library.
bbrown
A: 

Are you generating them on the iPhone? If so, this message plus the example code in the Certificate, Key, and Trust Services Programming Guide should steer you in the right direction. If not, I'm working on some code that should accomplish that--it's not quite there yet.

bbrown
Keep me posted!