• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
SecKeyGeneratePair export Public Key and OpenSSL API
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SecKeyGeneratePair export Public Key and OpenSSL API


  • Subject: SecKeyGeneratePair export Public Key and OpenSSL API
  • From: Jacopo Mangiavacchi <email@hidden>
  • Date: Tue, 4 Nov 2008 16:59:44 +0100

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@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: SecKeyGeneratePair export Public Key and OpenSSL API
      • From: Nicko van Someren <email@hidden>
  • Prev by Date: Re: Underlining text in Interface Builder
  • Next by Date: Re: Underlining text in Interface Builder
  • Previous by thread: Re: Programatically Change NSMenu Title
  • Next by thread: Re: SecKeyGeneratePair export Public Key and OpenSSL API
  • Index(es):
    • Date
    • Thread