74 #define PROG spkac_main
80 int MAIN(
int,
char **);
82 int MAIN(
int argc,
char **argv)
85 int i,badops=0, ret = 1;
87 int verify=0,noout=0,pubkey=0;
88 char *infile = NULL,*outfile = NULL,*prog;
89 char *passargin = NULL, *passin = NULL;
90 const char *spkac =
"SPKAC", *spksect =
"default";
92 char *challenge = NULL, *keyfile = NULL;
96 #ifndef OPENSSL_NO_ENGINE
112 if (strcmp(*argv,
"-in") == 0)
114 if (--argc < 1)
goto bad;
117 else if (strcmp(*argv,
"-out") == 0)
119 if (--argc < 1)
goto bad;
122 else if (strcmp(*argv,
"-passin") == 0)
124 if (--argc < 1)
goto bad;
125 passargin= *(++argv);
127 else if (strcmp(*argv,
"-key") == 0)
129 if (--argc < 1)
goto bad;
132 else if (strcmp(*argv,
"-challenge") == 0)
134 if (--argc < 1)
goto bad;
135 challenge= *(++argv);
137 else if (strcmp(*argv,
"-spkac") == 0)
139 if (--argc < 1)
goto bad;
142 else if (strcmp(*argv,
"-spksect") == 0)
144 if (--argc < 1)
goto bad;
147 #ifndef OPENSSL_NO_ENGINE
148 else if (strcmp(*argv,
"-engine") == 0)
150 if (--argc < 1)
goto bad;
154 else if (strcmp(*argv,
"-noout") == 0)
156 else if (strcmp(*argv,
"-pubkey") == 0)
158 else if (strcmp(*argv,
"-verify") == 0)
179 #ifndef OPENSSL_NO_ENGINE
191 #ifndef OPENSSL_NO_ENGINE
197 strcmp(keyfile,
"-") ? keyfile : NULL,
202 spki = NETSCAPE_SPKI_new();
204 challenge, (
int)strlen(challenge));
212 #ifdef OPENSSL_SYS_VMS
270 #ifdef OPENSSL_SYS_VMS
295 if(pubkey) PEM_write_bio_PUBKEY(out, pkey);
301 NETSCAPE_SPKI_free(spki);