This is straight out of the openssl verify program, and seems to be
exactly what you need:

static X509_CRL *load_crl(char *infile, int format)
{
X509_CRL *x=NULL;
BIO *in=NULL;

in=BIO_new(BIO_s_file());
if (in == NULL)
{
ERR_print_errors(bio_err);
goto end;
}

if (infile == NULL)
BIO_set_fp(in,stdin,BIO_NOCLOSE);
else
{
if (BIO_read_filename(in,infile) <= 0)
{
perror(infile);
goto end;
}
}
if (format == FORMAT_ASN1)
x=d2i_X509_CRL_bio(in,NULL);
else if (format == FORMAT_PEM)
x=PEM_read_bio_X509_CRL(in,NULL,NULL,NULL);
else {
BIO_printf(bio_err,"bad input format specified for input crl\n");
goto end;
}
if (x == NULL)
{
BIO_printf(bio_err,"unable to load CRL\n");
ERR_print_errors(bio_err);
goto end;
}

end:
BIO_free(in);
return(x);
}
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org
          • Re: Una... Patrick Patterson
            • RE... Radha krishna Meduri -X (radmedur - HCL at Cisco)
              • ... Patrick Patterson
              • ... Dr. Stephen Henson
              • ... Radha krishna Meduri -X (radmedur - HCL at Cisco)
              • ... Radha krishna Meduri -X (radmedur - HCL at Cisco)
              • ... Christian Hohnstaedt
              • ... Radha krishna Meduri -X (radmedur - HCL at Cisco)
              • ... sandeep kiran p
              • ... Dave Thompson
  • RE: Unable to load CRL Shane Steidley

Reply via email to