- in=BIO_new(BIO_s_file());
- if (in == NULL)
- {
- ERR_print_errors(bio_err);
- goto end;
- }
-
- if (file == NULL)
- BIO_set_fp(in,stdin,BIO_NOCLOSE);
- else
- {
- if (BIO_read_filename(in,file) <= 0)
- {
- perror(file);
- goto end;
- }
- }
-
- x=PEM_read_bio_X509(in,NULL,NULL,NULL);
+ x = load_cert(bio_err, file, FORMAT_PEM, NULL, e, "certificate file");