243
in=BIO_new(BIO_s_file());
244
241
out=BIO_new(BIO_s_file());
245
if ((in == NULL) || (out == NULL))
247
244
ERR_print_errors(bio_err);
252
BIO_set_fp(in,stdin,BIO_NOCLOSE);
255
if (BIO_read_filename(in,infile) <= 0)
262
248
BIO_printf(bio_err,"read DSA key\n");
263
if (informat == FORMAT_ASN1) {
264
if(pubin) dsa=d2i_DSA_PUBKEY_bio(in,NULL);
265
else dsa=d2i_DSAPrivateKey_bio(in,NULL);
266
} else if (informat == FORMAT_PEM) {
267
if(pubin) dsa=PEM_read_bio_DSA_PUBKEY(in,NULL, NULL, NULL);
268
else dsa=PEM_read_bio_DSAPrivateKey(in,NULL,NULL,passin);
271
BIO_printf(bio_err,"bad input format specified for key\n");
252
pkey = load_pubkey(bio_err, infile, informat, 1,
253
passin, e, "Public Key");
255
pkey = load_key(bio_err, infile, informat, 1,
256
passin, e, "Private Key");
259
dsa = pkey == NULL ? NULL : EVP_PKEY_get1_DSA(pkey);
276
264
BIO_printf(bio_err,"unable to load Key\n");