On Jul 12, 2007, at 9:29 PM, imin macho wrote:

hi...

i'm a noob in openssl.. my employee asked me to edit our c++ cert issuer engine developed using openssl. currently the cert generated will be valid based on the time we generate it. for example, if i generate a cert at 13 july 2007 1:30pm and set its validity for 5 days, the cert will be valid only till 18 july 2007 1:30 pm.. what should I do to make the cert valid till 11:59pm on that day? This is what my boss asked me to do.. please help.. any help is greatly appreciated.


Cert signing routines generally set the not-before and not-after times relative to "now". So you'll need to find a tie in seconds that represents midnight of some day. Then find the difference from that time to "now".

Do a UNIX "man mktime". It describes several routines that manipulate a "tm" structure. Basically, you convert the current expire time to a tm struct, set the day to what you want, set the hour, minute, and second to maximum, and convert back to a time_t.

Jim

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to