On May 13, 2014, at 22:20, Devarshi Kulshreshtha <devarshi.bluec...@gmail.com> wrote:
> In CyrptoExercise sample provided by apple, we have a wrapper class: > SecKeyWrapper. First, I think CryptoExercise is out of date. It’s not included in Xcode 5.1’s doc set. I found it on Apple’s website, but it looks like it was last updated for iOS 3, and it has a bunch of obsolete workarounds for running in the simulator (a long time ago the Keychain APIs were different in the device and simulator environments.) > Shall I use below code to create and send an encoded string to server: > 1. SecKeyWrapper *keyWrapper = [SecKeyWrapper sharedWrapper]; > 2. NSData *publicKeyData = [keyWrapper getPublicKeyBits]; It’s sample code, not a black box, so you can look at what it does yourself. The two lines you gave aren’t going to do anything by themselves — getPublicKeyBits just reads an already-existing public key out of the Keychain and encodes it. You have to generate the key first. —Jens PS: This discussion really belongs on the apple_cdsa list, which is for crypto/security discussions. Unfortunately Apple’s engineers never help out on that list (unlike on xcode-users or macnetworkprog), but there are some other fairly knowledgeable people there. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com