[pyOpenSSL] notBefore and notAfter (was Re: pyOpenSSL certificate information - how?)

Mihai Ibanescu misa at redhat.com
Sun Aug 8 14:19:20 CEST 2004


On Sun, Aug 08, 2004 at 02:02:33PM +0200, Martin Sjögren wrote:
> On Fri, 6 Aug 2004 10:54:37 -0400, Mihai Ibanescu <misa at redhat.com> wrote:
> > On a slightly related note.
> > I cannot seem to be able to retrieve notBefore and notAfter from an X509 cert.
> > I suppose that would be a good thing to add, wouldn't it?
> > (I found how to set them, but not how to retrieve them).
> 
> Well, ASN1_TIME in openssl is something of a mess. There's no good way
> to turn it into e.g. a time_t that could make sense in a python
> program. From what I understand of the code, you can basically do the
> following with an ASN1_TIME:
> * print it (ASN1_TIME_print / ASN1_UTCTIME_print)
> * set/adjust it (ASN1_TIME_set / X509_time_adj / X509_gmtime_adj / ...)
> * compare it (ASN1_UTCTIME_cmp_time_t)

That's what I figured when I tried to add them myself.



More information about the pyopenssl-users mailing list