I need to export a public key generated with the SecKeyGeneratePair API and send it to a WebServices (written in PHP) that using the OpenSSL API must encrypt something using this key and return back the ciphered value to the cocoa client.

In order to pass the public key NSData buffer I've tried to encode that in Base64 format and to pass it as a standard RSA pubkey string because I know that OpenSSL can accept a string like that.

An example of this kind of string is the following:

-----BEGIN PUBLIC KEY-----
MIGIAoGAUHmlTMGzxJ8Q+M3hlqSiZmn0wKKYqaih9gGfMkRPXBT4jpOiE6VOVuWN
jedIs97H4GRe4ZlmGAqMD5BK9NztHVOGPPYYjXT7u02kppkgYDoOhI7iYFJ/iHGi
eDwzUzCo5QEjeateX1fNVNhXzLs3T45/YVN3ezRqOmjJqs31cvUCAwEAAQ==
-----END PUBLIC KEY-----


Any way, the OpenSSL is telling me that this is not a valid public key. Btw, an OpenSSL auto-generated public key is a little bit longer than this, like the following for eample:


-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC5F3OcVyc93DPSYgltiYN6zkwM
Aq30nGq1j8PSJbfqu99q1xwprK0Uh078d09piTrOwjdmqUUHjHhJqSdeSbnF0oYp
XIQLXUb01wMfB6pKpfOHpLtDjAKJBeEfIK5Zig5nF1cQrKTIlR+LLR+7m0u5UDGB
rO7yvd5dYDJAKh9BawIDAQAB
-----END PUBLIC KEY-----


Am I missing something ?

Thanks for any help,
jacopo


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to