Re: ASN1_TIME to time_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 06, 2017, Dmitry Belyavsky wrote:

> Dear Matt,
> 
> On Wed, Sep 6, 2017 at 11:16 AM, Matt Caswell <matt@xxxxxxxxxxx> wrote:
> 
> >
> >
> > On 06/09/17 09:12, Dmitry Belyavsky wrote:
> > > Hello,
> > >
> > > Is there a way to convert ASN1_TIME to time_t or smth compatible? Quick
> > > googling does not show good results.
> >
> > In master you can use ASN1_TIME_to_tm() which will give you a struct tm.
> > Not available in released versions yet though.
> >
> 
> Is it implementable via API in 1.0.2?
> 

No but there is a a round about way of achieving the same result. The
ASN1_TIME_diff() function will determine the difference between two ASN1_TIME
structures and return the result as a number of days and seconds.

So if you set one to the epoch time you can then calculate the time_t from the
difference.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux