72 #define PROG pkcs7_main
81 int MAIN(
int,
char **);
83 int MAIN(
int argc,
char **argv)
88 int informat,outformat;
89 char *infile,*outfile,*prog;
90 int print_certs=0,
text=0,noout=0,p7_print=0;
92 #ifndef OPENSSL_NO_ENGINE
115 if (strcmp(*argv,
"-inform") == 0)
117 if (--argc < 1)
goto bad;
120 else if (strcmp(*argv,
"-outform") == 0)
122 if (--argc < 1)
goto bad;
125 else if (strcmp(*argv,
"-in") == 0)
127 if (--argc < 1)
goto bad;
130 else if (strcmp(*argv,
"-out") == 0)
132 if (--argc < 1)
goto bad;
135 else if (strcmp(*argv,
"-noout") == 0)
137 else if (strcmp(*argv,
"-text") == 0)
139 else if (strcmp(*argv,
"-print") == 0)
141 else if (strcmp(*argv,
"-print_certs") == 0)
143 #ifndef OPENSSL_NO_ENGINE
144 else if (strcmp(*argv,
"-engine") == 0)
146 if (--argc < 1)
goto bad;
172 #ifndef OPENSSL_NO_ENGINE
181 #ifndef OPENSSL_NO_ENGINE
187 if ((in == NULL) || (out == NULL))
208 p7=PEM_read_bio_PKCS7(in,NULL,NULL,NULL);
224 #ifdef OPENSSL_SYS_VMS
241 PKCS7_print_ctx(out, p7, 0, NULL);
252 certs=p7->
d.
sign->cert;
253 crls=p7->
d.
sign->crl;
273 if(!noout) PEM_write_bio_X509(out,x);
287 if(!noout)PEM_write_bio_X509_CRL(out,crl);
300 i=PEM_write_bio_PKCS7(out,p7);
315 if (p7 != NULL) PKCS7_free(p7);