Thanks a lot!!! It´s working!!!

I used the first part of your code...
Now, what BIO_s_file and Bio_set_fp actually do???

Thanks again!!!
Marcos


 --- Lee Baydush <[EMAIL PROTECTED]> escreveu: 
> ok.  It must be the bio then.  If you are
> debugging/running this in a console window, try
> this...
> BIO *bio_out;
> bio_out=BIO_new(BIO_s_file());
> ASSERT(bio_out!=NULL);
> BIO_set_fp(bio_out, stdout, BIO_NOCLOSE);
> ASN1_TIME_print(bio_out, X509_get_notAfter(cert));
> BIO_free_all(bio_out);
> Otherwise, you can do the following to put it into a
> buffer and then do whatever you want with it.
> char buf[128];
> BIO *bio_mem;
> bio_mem = BIO_new_mem_buf((void *)buf, 128);
> ASSERT(bio_mem!=NULL);
> ASN1_TIME_print(bio_mem, X509_get_notAfter(cert));
> BIO_free(bio_mem);
> 
> 
> 
> -----Original Message-----
> From: Marcos Paraiso
> [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 20, 2004 9:25 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Problems with get_notAfter
> 
> 
> Yes, I checked if the hbio and the cert were
> properly
> loaded (hbio!= NULL and cert!= NULL)... As I wrote
> before, I was able to print the full cert...
> 
> Marcos
> 
>  --- Lee Baydush <[EMAIL PROTECTED]> escreveu: 
> Do you know are you trying to output to an input
> only BIO?  I assume you also checked the hbio!=NULL
> and cert!=NULL?
> > 
> > -----Original Message-----
> > From: Marcos Paraiso
> > [mailto:[EMAIL PROTECTED]
> > Sent: Monday, September 20, 2004 9:08 AM
> > To: [EMAIL PROTECTED]
> > Subject: Problems with get_notAfter
> > 
> > 
> > Hi everebody,
> > 
> > I´m new with OpenSSL and am having some trouble
> ...
> > I´m trying to print the endDate of a certificate,
> > using the ASN1_TIME_print function but nothing
> > happens.
> > 
> > Here´s an excerpt from the code:
> > 
> > FILE *file;
> > BIO *hbio;
> > X509 *cert;
> > 
> > hbio = BIO_new_file(file, "r");
> > cert = PEM_read_bio_X509(hbio, NULL, NULL, NULL);
> > ASN1_TIME_print(hbio, X509_get_notAfter(cert));
> > 
> > I also used the UTCTIME function, but again
> nothing
> > happened...
> > 
> > The function that prints all the certificate works
> > just fine, but I only need the endDate!!!
> > 
> > Could someone PLEASE help me?!?
> > 
> > Thanks...
> > Marcos
> > 
> > =====


=====



        
        
                
_______________________________________________________
Yahoo! Messenger 6.0 - jogos, emoticons sonoros e muita diversão. Instale agora!
http://br.download.yahoo.com/messenger/
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to