65 #define PROG pkey_main
67 int MAIN(
int,
char **);
69 int MAIN(
int argc,
char **argv)
72 char **args, *infile = NULL, *outfile = NULL;
73 char *passargin = NULL, *passargout = NULL;
76 int informat, outformat;
77 int pubin = 0, pubout = 0, pubtext = 0,
text = 0, noout = 0;
79 char *passin = NULL, *passout = NULL;
81 #ifndef OPENSSL_NO_ENGINE
98 while (!badarg && *args && *args[0] ==
'-')
100 if (!strcmp(*args,
"-inform"))
109 else if (!strcmp(*args,
"-outform"))
118 else if (!strcmp(*args,
"-passin"))
120 if (!args[1])
goto bad;
121 passargin= *(++args);
123 else if (!strcmp(*args,
"-passout"))
125 if (!args[1])
goto bad;
126 passargout= *(++args);
128 #ifndef OPENSSL_NO_ENGINE
129 else if (strcmp(*args,
"-engine") == 0)
131 if (!args[1])
goto bad;
135 else if (!strcmp (*args,
"-in"))
144 else if (!strcmp (*args,
"-out"))
153 else if (strcmp(*args,
"-pubin") == 0)
159 else if (strcmp(*args,
"-pubout") == 0)
161 else if (strcmp(*args,
"-text_pub") == 0)
166 else if (strcmp(*args,
"-text") == 0)
168 else if (strcmp(*args,
"-noout") == 0)
194 #ifndef OPENSSL_NO_ENGINE
200 #ifndef OPENSSL_NO_ENGINE
215 "Can't open output file %s\n", outfile);
222 #ifdef OPENSSL_SYS_VMS
232 passin, e,
"Public Key");
244 PEM_write_bio_PUBKEY(out,pkey);
247 NULL, 0, NULL, passout);