on iOS .. unless any new security api points were added in the last release or 
two, it's not very easy.  iOS is pretty weak here and my bugreport asking for 
more security API points remains open. 

You can call SecCertificateCopyData which gives you a DER encoded X.509 cert 
which you then stick through an ASN1 parser and extract the bits you want. Or 
if you are feeling lucky you can scan the raw data for the patterns which match 
the information in the ASN1 data and pick out just the bits you need. I wrote a 
parser as it's a handy thing to have in the toolbox. 

There's a SecCertificateCopySubjectSummary function which returns a CFString, I 
have no idea what's in it, if it has any information you'd find useful, rather 
doubt it has all the stuff you want, however you could try displaying that to 
the user. 



On 17 Nov, 2013, at 11:07 am, Devarshi Kulshreshtha 
<[email protected]> wrote:

> one more quick question.. how can I extract information from this class:
> SecCertificateRef
> 
> Its syntax seems to be very weird as compared to normal cocoa classes :-(
> 
> If you can give some example of extracting - organization name, email
> address, and expiry date, it will be very helpful.
> 
> 
> On Sat, Nov 16, 2013 at 8:46 PM, Jens Alfke <[email protected]> wrote:
> 
>> 
>> On Nov 16, 2013, at 6:41 PM, Devarshi Kulshreshtha <
>> [email protected]> wrote:
>> 
>> Q1. How can I obtain above enlisted information? Is there any cocoa API to
>> provide the same?
>> 
>> 
>> SecCertificateRef
>> 
>> Q2. Generally in a web browser it presents all details related to that
>> certificate. Do we need to follow the same behavior in an iOS app?
>> 
>> 
>> That’s up to you, I think.
>> 
>> —Jens
>> 
> 
> 
> 
> -- 
> Thanks,
> 
> Devarshi
> _______________________________________________
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
> 
> This email sent to [email protected]


_______________________________________________

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

This email sent to [email protected]

Reply via email to