11 int main(
int argc,
char **argv)
20 fprintf(stderr,
"Usage: pkread p12file password opfile\n");
25 if (!(fp = fopen(argv[1],
"rb"))) {
26 fprintf(stderr,
"Error opening file %s\n", argv[1]);
32 fprintf(stderr,
"Error reading PKCS#12 file\n");
37 fprintf(stderr,
"Error parsing PKCS#12 file\n");
42 if (!(fp = fopen(argv[3],
"w"))) {
43 fprintf(stderr,
"Error opening file %s\n", argv[1]);
47 fprintf(fp,
"***Private Key***\n");
51 fprintf(fp,
"***User Certificate***\n");
52 PEM_write_X509_AUX(fp, cert);
55 fprintf(fp,
"***Other Certificates***\n");