My mistake it was ASN1_TIME that is correct.

But any way, I don't see a reason why I should not be able to convert
it, if I don't care for milliseconds, time_t can represent times for
up to 2038, so It should be ok to convert it to the time_t.

Any ideas, the ASN1_cmp_time does much more than what I need, because
I will be comparing at least once a second (If I check the last time
to be at least one second earlier.) And because they are all in my
cache for hopefully lets say a year, why not convert it to time_t and
just check it with > current_gmt_time ?



On 1/28/06, Dr. Stephen Henson wrote:
> On Sat, Jan 28, 2006, Joe Gluck wrote:
> > Thank you for all tour replies but the gettimeofday I already use, but
> > it was not what I was asking in the original message.
> >
> > What I asked is how can I get the ASN1_integer into a time_t to be
> > able to compare it with the current GMT time (which i can get with
> > some system functions, on linux gettimeofday)? (See first message in
> > thread)
> >

> Actually you asked how to convert an ASN1_TIME to time_t. The answer in
> general to that is "you can't" because an ASN1_TIME can express a wider r=

> of dates than a typical 32 bit time_t.
> If you want to compare an ASN1_TIME to the current time that's a differen=

> thing entirely. What OpenSSL does is to convert the time_t into an ASN1_T=

> and compares the two ASN1_TIME structures.
> There is a function called X509_cmp_time() that does the conversion and
> comparison. It can be fed either a pointer to a time_t with the time to
> compare against or NULL which uses the current time.
> Steve.
> --
> Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
> OpenSSL project core developer and freelance consultant.
> Funding needed! Details on homepage.
> Homepage:
> __________________________________________________ ____________________
> OpenSSL Project
> Development Mailing List
> Automated List Manager

__________________________________________________ ____________________
OpenSSL Project
Development Mailing List
Automated List Manager