> hi DS,
>        here is the code snippet i'm using:
>
>   X509 *cert;
>   FILE fp;
>   fp=fopen("cacert.der","r");
>   /* error check*/
>   cert=d2i_X509_fp(fp,NULL);
>   /* error check*/
>   printf("Valid From : %d",X509_get_notBefore(cert));
>   /*gives 13 and when printed using %s, it gives
> segmentation fault*/
>
>      actually, the call X509_get_notBefore() is a macro
> defined in ssl.h as
>
>   #define X509_get_notBefore(x)
> ((x)->cert_info->validity->notBefore)
>
> and the data type of the member 'notBefore' is ASN1_TIME
> . am i doing something wrong and do u have any idea that
> how can i parse and print the date elements?
>
> thanx and regards,
>   -Vipin
>


Well, if you just want to print a date, use
ASN1_TIME_print(BIO*, ASN1_TIME*)




-----------------------------

Хостинг от Tophost.bg
99,9 % uptime
24/7 поддръжка 
отлична видимост от цял свят.
http://www.tophost.bg/

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

Reply via email to