Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Great question! If I were doing this coding, I would first try to think of a solution using Keychain Services.</p> <p>First, you'd need to fetch the keychain item. Say, via <a href="http://developer.apple.com/library/ios/documentation/Security/Reference/keychainservices/Reference/reference.html#//apple_ref/c/func/SecItemCopyMatching" rel="nofollow">`SecItemCopyMatching()'</a>.</p> <p>This returns a reference to the found items. Preferably a <code>SecCertificateRef</code> (which is described more in detail in Apple's <a href="http://developer.apple.com/library/ios/#documentation/Security/Reference/keychainservices/Reference/reference.html" rel="nofollow">Keychain Services Reference</a> guide).</p> <p>I don't see an easy way to explicitly fetch the metadata (or expiration date) from a <code>SecCertificateRef</code> off the top of my head. <a href="http://books.google.com/books?id=OG6_lsfffjkC&amp;lpg=PA218&amp;ots=osRjqNWp6J&amp;dq=SecCertificateRef%20metadata&amp;pg=PA218#v=onepage&amp;q=SecCertificateRef%20metadata&amp;f=false" rel="nofollow">There's a code snippet I found on books.google.com</a> from "IOS 5 Programming Pushing the Limits: Developing Extraordinary Mobile Apps" called "Checking Certificate Validity" (pages 218 &amp; 219 -- I've linked it for you) which basically checks to see if a certificate allows usage based on matching keys (in their example, it's the subject or domain name; for you, it would be the expiration date). Their technique may help you out. </p> <p>As for using OpenSSL, <a href="http://www.brandonhutchinson.com/When_does_my_certificate_expire%3F.html" rel="nofollow">I found an answer where you can come up with the expiration date from the command line using the openssl tool</a>. If you can get a handle to your certificate, I'm pretty certain this can be done programmatically as well.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload