60 #ifndef OPENSSL_NO_RSA
98 int MAIN(
int,
char **);
100 int MAIN(
int argc,
char **argv)
105 int i,badops=0, sgckey=0;
108 int informat,outformat,
text=0,check=0,noout=0;
109 int pubin = 0, pubout = 0;
110 char *infile,*outfile,*prog;
111 char *passargin = NULL, *passargout = NULL;
112 char *passin = NULL, *passout = NULL;
113 #ifndef OPENSSL_NO_ENGINE
139 if (strcmp(*argv,
"-inform") == 0)
141 if (--argc < 1)
goto bad;
144 else if (strcmp(*argv,
"-outform") == 0)
146 if (--argc < 1)
goto bad;
149 else if (strcmp(*argv,
"-in") == 0)
151 if (--argc < 1)
goto bad;
154 else if (strcmp(*argv,
"-out") == 0)
156 if (--argc < 1)
goto bad;
159 else if (strcmp(*argv,
"-passin") == 0)
161 if (--argc < 1)
goto bad;
162 passargin= *(++argv);
164 else if (strcmp(*argv,
"-passout") == 0)
166 if (--argc < 1)
goto bad;
167 passargout= *(++argv);
169 #ifndef OPENSSL_NO_ENGINE
170 else if (strcmp(*argv,
"-engine") == 0)
172 if (--argc < 1)
goto bad;
176 else if (strcmp(*argv,
"-sgckey") == 0)
178 else if (strcmp(*argv,
"-pubin") == 0)
180 else if (strcmp(*argv,
"-pubout") == 0)
182 else if (strcmp(*argv,
"-RSAPublicKey_in") == 0)
184 else if (strcmp(*argv,
"-RSAPublicKey_out") == 0)
186 else if (strcmp(*argv,
"-pvk-strong") == 0)
188 else if (strcmp(*argv,
"-pvk-weak") == 0)
190 else if (strcmp(*argv,
"-pvk-none") == 0)
192 else if (strcmp(*argv,
"-noout") == 0)
194 else if (strcmp(*argv,
"-text") == 0)
196 else if (strcmp(*argv,
"-modulus") == 0)
198 else if (strcmp(*argv,
"-check") == 0)
223 BIO_printf(
bio_err,
" -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
224 #ifndef OPENSSL_NO_IDEA
227 #ifndef OPENSSL_NO_SEED
230 #ifndef OPENSSL_NO_AES
234 #ifndef OPENSSL_NO_CAMELLIA
244 #ifndef OPENSSL_NO_ENGINE
252 #ifndef OPENSSL_NO_ENGINE
284 tmpformat = informat;
287 passin, e,
"Public Key");
293 passin, e,
"Private Key");
309 #ifdef OPENSSL_SYS_VMS
383 #ifndef OPENSSL_NO_RC4
386 unsigned char *
p,*
pp;
406 i=PEM_write_bio_RSAPublicKey(out,rsa);
408 i=PEM_write_bio_RSA_PUBKEY(out,rsa);
410 else i=PEM_write_bio_RSAPrivateKey(out,rsa,
411 enc,NULL,0,NULL,passout);
412 #if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_RC4)
419 else if (pubin || pubout)
447 static void *dummy=&dummy;