On May 21, 2014, at 12:41 AM, Devarshi Kulshreshtha 
<devarshi.bluec...@gmail.com> wrote:

> Is there any method to generate .cer file in cocoa?

Not unless you already have a SecCertificateRef (which is just a wrapper around 
the same data that goes in a .cer file.)

Generating X.509 certificates is hard. OS X has some APIs for outputting ASN.1 
but they’re hard to use, and you have to figure out the exact ASN.1 structure 
that makes up the cert. iOS doesn’t even have those APIs.

And guess what? To generate the certificate you still have to know the modulus 
and exponent of the public key, i.e. the raw public key data. Which is the 
problem you’re trying to work around with this.

There really is no alternative to groping the innards of the public key blob 
returned from the Keychain. Even if it’s undocumented and even if Quinn says 
not to. Apple has fscked up their security APIs to the point that you have to 
do it.

—Jens
_______________________________________________

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

Reply via email to