Specifying an engine (by its unique id string) will cause genpkey
to attempt to obtain a functional reference to the specified engine,
thus initialising it if needed. The engine will then be set as the default
for all available algorithms. If used this option should precede all other
options.
Public key algorithm to use such as RSA, DSA or DH. If used this option must
precede any -pkeyopt options. The options -paramfile and -algorithm
are mutually exclusive. Engines may add algorithms in addition to the standard
built-in ones.
Valid built-in algorithm names for private key generation are RSA, RSA-PSS, EC,
X25519, X448, ED25519 and ED448.
Valid built-in algorithm names for parameter generation (see the -genparam
option) are DH, DSA and EC.
Note that the algorithm name X9.42 DH may be used as a synonym for the DH
algorithm. These are identical and do not indicate the type of parameters that
will be generated. Use the dh_paramgen_type option to indicate whether PKCS#3
or X9.42 DH parameters are required. See DH Parameter Generation Options
below for more details.
Set the public key algorithm option opt to value. The precise set of
options supported depends on the public key algorithm used and its
implementation. See KEY GENERATION OPTIONS and
PARAMETER GENERATION OPTIONS below for more details.
Some public key algorithms generate a private key based on a set of parameters.
They can be supplied using this option. If this option is used the public key
algorithm used is determined by the parameters. If used this option must
precede any -pkeyopt options. The options -paramfile and -algorithm
are mutually exclusive.
The options supported by each algorithm and indeed each implementation of an
algorithm can vary. The options for the OpenSSL implementations are detailed
below. There are no key generation options defined for the X25519, X448, ED25519
or ED448 algorithms.
The options supported by each algorithm and indeed each implementation of an
algorithm can vary. The options for the OpenSSL implementations are detailed
below.
The digest to use during parameter generation. Must be one of sha1, sha224
or sha256. If set, then the number of bits in q will match the output size
of the specified digest and the dsa_paramgen_q_bits parameter will be
ignored. If not set, then a digest will be used that gives an output matching
the number of bits in q, i.e. sha1 if q length is 160, sha224 if it 224
or sha256 if it is 256.
The number of bits in the sub prime parameter q. The default is 256 if the
prime is at least 2048 bits long or 160 otherwise. Only relevant if used in
conjunction with the dh_paramgen_type option to generate X9.42 DH parameters.
If this option is set, then the appropriate RFC5114 parameters are used
instead of generating new parameters. The value num can take the
values 1, 2 or 3 corresponding to RFC5114 DH parameters consisting of
1024 bit group with 160 bit subgroup, 2048 bit group with 224 bit subgroup
and 2048 bit group with 256 bit subgroup as mentioned in RFC5114 sections
2.1, 2.2 and 2.3 respectively. If present this overrides all other DH parameter
options.
The use of the genpkey program is encouraged over the algorithm specific
utilities because additional algorithm options and ENGINE provided algorithms
can be used.
The ability to use NIST curve names, and to generate an EC key directly,
were added in OpenSSL 1.0.2.
The ability to generate X25519 keys was added in OpenSSL 1.1.0.
The ability to generate X448, ED25519 and ED448 keys was added in OpenSSL 1.1.1.
Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the OpenSSL license (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
https://www.openssl.org/source/license.html.