62 #ifdef OPENSSL_NO_DEPRECATED
63 #undef OPENSSL_NO_DEPRECATED
66 #ifndef OPENSSL_NO_RSA
69 #include <sys/types.h>
83 #define PROG genrsa_main
87 int MAIN(
int,
char **);
89 int MAIN(
int argc,
char **argv)
92 #ifndef OPENSSL_NO_ENGINE
101 char *passargout = NULL, *passout = NULL;
102 #ifndef OPENSSL_NO_ENGINE
131 if (argc <= 0)
break;
132 if (strcmp(*argv,
"-out") == 0)
134 if (--argc < 1)
goto bad;
137 else if (strcmp(*argv,
"-3") == 0)
139 else if (strcmp(*argv,
"-F4") == 0 || strcmp(*argv,
"-f4") == 0)
141 #ifndef OPENSSL_NO_ENGINE
142 else if (strcmp(*argv,
"-engine") == 0)
144 if (--argc < 1)
goto bad;
148 else if (strcmp(*argv,
"-rand") == 0)
150 if (--argc < 1)
goto bad;
153 #ifndef OPENSSL_NO_DES
154 else if (strcmp(*argv,
"-des") == 0)
156 else if (strcmp(*argv,
"-des3") == 0)
159 #ifndef OPENSSL_NO_IDEA
160 else if (strcmp(*argv,
"-idea") == 0)
163 #ifndef OPENSSL_NO_SEED
164 else if (strcmp(*argv,
"-seed") == 0)
167 #ifndef OPENSSL_NO_AES
168 else if (strcmp(*argv,
"-aes128") == 0)
170 else if (strcmp(*argv,
"-aes192") == 0)
172 else if (strcmp(*argv,
"-aes256") == 0)
175 #ifndef OPENSSL_NO_CAMELLIA
176 else if (strcmp(*argv,
"-camellia128") == 0)
178 else if (strcmp(*argv,
"-camellia192") == 0)
180 else if (strcmp(*argv,
"-camellia256") == 0)
183 else if (strcmp(*argv,
"-passout") == 0)
185 if (--argc < 1)
goto bad;
186 passargout= *(++argv);
193 if ((argc >= 1) && ((sscanf(*argv,
"%d",&num) == 0) || (num < 0)))
198 BIO_printf(
bio_err,
" -des3 encrypt the generated key with DES in ede cbc mode (168 bit key)\n");
199 #ifndef OPENSSL_NO_IDEA
202 #ifndef OPENSSL_NO_SEED
206 #ifndef OPENSSL_NO_AES
210 #ifndef OPENSSL_NO_CAMELLIA
218 #ifndef OPENSSL_NO_ENGINE
234 #ifndef OPENSSL_NO_ENGINE
241 #ifdef OPENSSL_SYS_VMS
260 BIO_printf(
bio_err,
"warning, not much extra random data, consider using the -rand option\n");
268 #ifdef OPENSSL_NO_ENGINE
284 for (i=0; i<rsa->
e->
top; i++)
286 #ifndef SIXTY_FOUR_BIT
297 if (!PEM_write_bio_RSAPrivateKey(out,rsa,enc,NULL,0,
332 static void *dummy=&dummy;