1GENRSA(1) OpenSSL GENRSA(1)
2
3
4
6 openssl-genrsa, genrsa - generate an RSA private key
7
9 openssl genrsa [-help] [-out filename] [-passout arg] [-aes128]
10 [-aes192] [-aes256] [-aria128] [-aria192] [-aria256] [-camellia128]
11 [-camellia192] [-camellia256] [-des] [-des3] [-idea] [-f4] [-3] [-rand
12 file...] [-writerand file] [-engine id] [-primes num] [numbits]
13
15 The genrsa command generates an RSA private key.
16
18 -help
19 Print out a usage message.
20
21 -out filename
22 Output the key to the specified file. If this argument is not
23 specified then standard output is used.
24
25 -passout arg
26 The output file password source. For more information about the
27 format of arg see "Pass Phrase Options" in openssl(1).
28
29 -aes128, -aes192, -aes256, -aria128, -aria192, -aria256, -camellia128,
30 -camellia192, -camellia256, -des, -des3, -idea
31 These options encrypt the private key with specified cipher before
32 outputting it. If none of these options is specified no encryption
33 is used. If encryption is used a pass phrase is prompted for if it
34 is not supplied via the -passout argument.
35
36 -F4|-3
37 The public exponent to use, either 65537 or 3. The default is
38 65537.
39
40 -rand file...
41 A file or files containing random data used to seed the random
42 number generator. Multiple files can be specified separated by an
43 OS-dependent character. The separator is ; for MS-Windows, , for
44 OpenVMS, and : for all others.
45
46 [-writerand file]
47 Writes random data to the specified file upon exit. This can be
48 used with a subsequent -rand flag.
49
50 -engine id
51 Specifying an engine (by its unique id string) will cause genrsa to
52 attempt to obtain a functional reference to the specified engine,
53 thus initialising it if needed. The engine will then be set as the
54 default for all available algorithms.
55
56 -primes num
57 Specify the number of primes to use while generating the RSA key.
58 The num parameter must be a positive integer that is greater than 1
59 and less than 16. If num is greater than 2, then the generated key
60 is called a 'multi-prime' RSA key, which is defined in RFC 8017.
61
62 numbits
63 The size of the private key to generate in bits. This must be the
64 last option specified. The default is 2048 and values less than 512
65 are not allowed.
66
68 RSA private key generation essentially involves the generation of two
69 or more prime numbers. When generating a private key various symbols
70 will be output to indicate the progress of the generation. A .
71 represents each number which has passed an initial sieve test, + means
72 a number has passed a single round of the Miller-Rabin primality test,
73 * means the current prime starts a regenerating progress due to some
74 failed tests. A newline means that the number has passed all the prime
75 tests (the actual number depends on the key size).
76
77 Because key generation is a random process the time taken to generate a
78 key may vary somewhat. But in general, more primes lead to less
79 generation time of a key.
80
82 gendsa(1)
83
85 Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
86
87 Licensed under the OpenSSL license (the "License"). You may not use
88 this file except in compliance with the License. You can obtain a copy
89 in the file LICENSE in the source distribution or at
90 <https://www.openssl.org/source/license.html>.
91
92
93
941.1.1k 2021-03-26 GENRSA(1)