Now I have a certificate which includes a public key,i want to get the public key from it in iPhone SDK programming, and encrypt a string by RSA with the public key.What should i do? Please help me!!Thanks very much.
A:
SecKeyRef publicKeyReference = NULL;
NSMutableDictionary* queryPublicKey;
SecItemCopyMatching((CFDictionaryRef)queryPublicKey, (CFTypeRef *)&publicKeyReference);
publicKeyReference - is your public key representation; queryPublicKey - is your certificate representation; SecItemCopyMatching - function that allows you to retrieve public key from certificate!
Aston
2010-04-12 08:39:26