In message <[EMAIL PROTECTED]> on Mon, 19 Jul 2004 13:27:12 +0200, "Dr. Stephen 
Henson" <[EMAIL PROTECTED]> said:

steve> On Mon, Jul 19, 2004, Richard Levitte - VMS Whacker wrote:
steve> 
steve> > Since you're doing this by programming:
steve> > 
steve> > - You get the validity limits, using the macros X509_get_notBefore() and
steve> >   X509_get_notAfter()
steve> > 
steve> > - extract the year from the limits, using the function
steve> >   ASN1_extract_year() (NOT TESTED!) below.
steve> > 
steve> > - subtract one year from the other and check that it's lower than 31.
steve> > 
steve> > 
steve> 
steve> One complication is that the subtraction would need to be
steve> decremented if one year day was before the first.
steve> 
steve> For example the difference between December 31st 2001 and
steve> January 1st 2002 is obviously less than a year.

Since the requested check is for the difference to be less than a
specific number of years, there's no problem in this case.

Of course, for the general case, it's a bit different...

And yeah, I thought about time zones, but as you say, that's not a
problem either in this specific case.

-----
Please consider sponsoring my work on free software.
See http://www.free.lp.se/sponsoring.html for details.

-- 
Richard Levitte   \ Tunnlandsvägen 52 \ [EMAIL PROTECTED]
[EMAIL PROTECTED]  \ S-168 36  BROMMA  \ T: +46-708-26 53 44
                    \      SWEDEN       \
Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/

-----------------------------------------------------------------
A: Because it fouls the order in which people normally read text. 
Q: Why is top-posting such a bad thing? 
A: Top-posting. 
Q: What is the most annoying thing on usenet and in e-mail?
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to