]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - secure/usr.bin/openssl/man/req.1
Update libdialog to 1.3-20180621
[FreeBSD/FreeBSD.git] / secure / usr.bin / openssl / man / req.1
1 .\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is >0, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .if !\nF .nr F 0
58 .if \nF>0 \{\
59 .    de IX
60 .    tm Index:\\$1\t\\n%\t"\\$2"
61 ..
62 .    if !\nF==2 \{\
63 .        nr % 0
64 .        nr F 2
65 .    \}
66 .\}
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "REQ 1"
132 .TH REQ 1 "2018-09-11" "1.1.1" "OpenSSL"
133 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
134 .\" way too many mistakes in technical documents.
135 .if n .ad l
136 .nh
137 .SH "NAME"
138 openssl\-req, req \- PKCS#10 certificate request and certificate generating utility
139 .SH "SYNOPSIS"
140 .IX Header "SYNOPSIS"
141 \&\fBopenssl\fR \fBreq\fR
142 [\fB\-help\fR]
143 [\fB\-inform PEM|DER\fR]
144 [\fB\-outform PEM|DER\fR]
145 [\fB\-in filename\fR]
146 [\fB\-passin arg\fR]
147 [\fB\-out filename\fR]
148 [\fB\-passout arg\fR]
149 [\fB\-text\fR]
150 [\fB\-pubkey\fR]
151 [\fB\-noout\fR]
152 [\fB\-verify\fR]
153 [\fB\-modulus\fR]
154 [\fB\-new\fR]
155 [\fB\-rand file...\fR]
156 [\fB\-writerand file\fR]
157 [\fB\-newkey rsa:bits\fR]
158 [\fB\-newkey alg:file\fR]
159 [\fB\-nodes\fR]
160 [\fB\-key filename\fR]
161 [\fB\-keyform PEM|DER\fR]
162 [\fB\-keyout filename\fR]
163 [\fB\-keygen_engine id\fR]
164 [\fB\-\f(BIdigest\fB\fR]
165 [\fB\-config filename\fR]
166 [\fB\-multivalue\-rdn\fR]
167 [\fB\-x509\fR]
168 [\fB\-days n\fR]
169 [\fB\-set_serial n\fR]
170 [\fB\-newhdr\fR]
171 [\fB\-addext ext\fR]
172 [\fB\-extensions section\fR]
173 [\fB\-reqexts section\fR]
174 [\fB\-precert\fR]
175 [\fB\-utf8\fR]
176 [\fB\-nameopt\fR]
177 [\fB\-reqopt\fR]
178 [\fB\-subject\fR]
179 [\fB\-subj arg\fR]
180 [\fB\-batch\fR]
181 [\fB\-verbose\fR]
182 [\fB\-engine id\fR]
183 .SH "DESCRIPTION"
184 .IX Header "DESCRIPTION"
185 The \fBreq\fR command primarily creates and processes certificate requests
186 in PKCS#10 format. It can additionally create self signed certificates
187 for use as root CAs for example.
188 .SH "OPTIONS"
189 .IX Header "OPTIONS"
190 .IP "\fB\-help\fR" 4
191 .IX Item "-help"
192 Print out a usage message.
193 .IP "\fB\-inform DER|PEM\fR" 4
194 .IX Item "-inform DER|PEM"
195 This specifies the input format. The \fB\s-1DER\s0\fR option uses an \s-1ASN1 DER\s0 encoded
196 form compatible with the PKCS#10. The \fB\s-1PEM\s0\fR form is the default format: it
197 consists of the \fB\s-1DER\s0\fR format base64 encoded with additional header and
198 footer lines.
199 .IP "\fB\-outform DER|PEM\fR" 4
200 .IX Item "-outform DER|PEM"
201 This specifies the output format, the options have the same meaning and default
202 as the \fB\-inform\fR option.
203 .IP "\fB\-in filename\fR" 4
204 .IX Item "-in filename"
205 This specifies the input filename to read a request from or standard input
206 if this option is not specified. A request is only read if the creation
207 options (\fB\-new\fR and \fB\-newkey\fR) are not specified.
208 .IP "\fB\-passin arg\fR" 4
209 .IX Item "-passin arg"
210 The input file password source. For more information about the format of \fBarg\fR
211 see the \fB\s-1PASS PHRASE ARGUMENTS\s0\fR section in \fIopenssl\fR\|(1).
212 .IP "\fB\-out filename\fR" 4
213 .IX Item "-out filename"
214 This specifies the output filename to write to or standard output by
215 default.
216 .IP "\fB\-passout arg\fR" 4
217 .IX Item "-passout arg"
218 The output file password source. For more information about the format of \fBarg\fR
219 see the \fB\s-1PASS PHRASE ARGUMENTS\s0\fR section in \fIopenssl\fR\|(1).
220 .IP "\fB\-text\fR" 4
221 .IX Item "-text"
222 Prints out the certificate request in text form.
223 .IP "\fB\-subject\fR" 4
224 .IX Item "-subject"
225 Prints out the request subject (or certificate subject if \fB\-x509\fR is
226 specified)
227 .IP "\fB\-pubkey\fR" 4
228 .IX Item "-pubkey"
229 Outputs the public key.
230 .IP "\fB\-noout\fR" 4
231 .IX Item "-noout"
232 This option prevents output of the encoded version of the request.
233 .IP "\fB\-modulus\fR" 4
234 .IX Item "-modulus"
235 This option prints out the value of the modulus of the public key
236 contained in the request.
237 .IP "\fB\-verify\fR" 4
238 .IX Item "-verify"
239 Verifies the signature on the request.
240 .IP "\fB\-new\fR" 4
241 .IX Item "-new"
242 This option generates a new certificate request. It will prompt
243 the user for the relevant field values. The actual fields
244 prompted for and their maximum and minimum sizes are specified
245 in the configuration file and any requested extensions.
246 .Sp
247 If the \fB\-key\fR option is not used it will generate a new \s-1RSA\s0 private
248 key using information specified in the configuration file.
249 .IP "\fB\-rand file...\fR" 4
250 .IX Item "-rand file..."
251 A file or files containing random data used to seed the random number
252 generator.
253 Multiple files can be specified separated by an OS-dependent character.
254 The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
255 all others.
256 .IP "[\fB\-writerand file\fR]" 4
257 .IX Item "[-writerand file]"
258 Writes random data to the specified \fIfile\fR upon exit.
259 This can be used with a subsequent \fB\-rand\fR flag.
260 .IP "\fB\-newkey arg\fR" 4
261 .IX Item "-newkey arg"
262 This option creates a new certificate request and a new private
263 key. The argument takes one of several forms. \fBrsa:nbits\fR, where
264 \&\fBnbits\fR is the number of bits, generates an \s-1RSA\s0 key \fBnbits\fR
265 in size. If \fBnbits\fR is omitted, i.e. \fB\-newkey rsa\fR specified,
266 the default key size, specified in the configuration file is used.
267 .Sp
268 All other algorithms support the \fB\-newkey alg:file\fR form, where file may be
269 an algorithm parameter file, created by the \fBgenpkey \-genparam\fR command
270 or and X.509 certificate for a key with appropriate algorithm.
271 .Sp
272 \&\fBparam:file\fR generates a key using the parameter file or certificate \fBfile\fR,
273 the algorithm is determined by the parameters. \fBalgname:file\fR use algorithm
274 \&\fBalgname\fR and parameter file \fBfile\fR: the two algorithms must match or an
275 error occurs. \fBalgname\fR just uses algorithm \fBalgname\fR, and parameters,
276 if necessary should be specified via \fB\-pkeyopt\fR parameter.
277 .Sp
278 \&\fBdsa:filename\fR generates a \s-1DSA\s0 key using the parameters
279 in the file \fBfilename\fR. \fBec:filename\fR generates \s-1EC\s0 key (usable both with
280 \&\s-1ECDSA\s0 or \s-1ECDH\s0 algorithms), \fBgost2001:filename\fR generates \s-1GOST R
281 34.10\-2001\s0 key (requires \fBccgost\fR engine configured in the configuration
282 file). If just \fBgost2001\fR is specified a parameter set should be
283 specified by \fB\-pkeyopt paramset:X\fR
284 .IP "\fB\-pkeyopt opt:value\fR" 4
285 .IX Item "-pkeyopt opt:value"
286 Set the public key algorithm option \fBopt\fR to \fBvalue\fR. The precise set of
287 options supported depends on the public key algorithm used and its
288 implementation. See \fB\s-1KEY GENERATION OPTIONS\s0\fR in the \fBgenpkey\fR manual page
289 for more details.
290 .IP "\fB\-key filename\fR" 4
291 .IX Item "-key filename"
292 This specifies the file to read the private key from. It also
293 accepts PKCS#8 format private keys for \s-1PEM\s0 format files.
294 .IP "\fB\-keyform PEM|DER\fR" 4
295 .IX Item "-keyform PEM|DER"
296 The format of the private key file specified in the \fB\-key\fR
297 argument. \s-1PEM\s0 is the default.
298 .IP "\fB\-keyout filename\fR" 4
299 .IX Item "-keyout filename"
300 This gives the filename to write the newly created private key to.
301 If this option is not specified then the filename present in the
302 configuration file is used.
303 .IP "\fB\-nodes\fR" 4
304 .IX Item "-nodes"
305 If this option is specified then if a private key is created it
306 will not be encrypted.
307 .IP "\fB\-\f(BIdigest\fB\fR" 4
308 .IX Item "-digest"
309 This specifies the message digest to sign the request.
310 Any digest supported by the OpenSSL \fBdgst\fR command can be used.
311 This overrides the digest algorithm specified in
312 the configuration file.
313 .Sp
314 Some public key algorithms may override this choice. For instance, \s-1DSA\s0
315 signatures always use \s-1SHA1, GOST R 34.10\s0 signatures always use
316 \&\s-1GOST R 34.11\-94\s0 (\fB\-md_gost94\fR), Ed25519 and Ed448 never use any digest.
317 .IP "\fB\-config filename\fR" 4
318 .IX Item "-config filename"
319 This allows an alternative configuration file to be specified.
320 Optional; for a description of the default value,
321 see \*(L"\s-1COMMAND SUMMARY\*(R"\s0 in \fIopenssl\fR\|(1).
322 .IP "\fB\-subj arg\fR" 4
323 .IX Item "-subj arg"
324 Sets subject name for new request or supersedes the subject name
325 when processing a request.
326 The arg must be formatted as \fI/type0=value0/type1=value1/type2=...\fR,
327 characters may be escaped by \e (backslash), no spaces are skipped.
328 .IP "\fB\-multivalue\-rdn\fR" 4
329 .IX Item "-multivalue-rdn"
330 This option causes the \-subj argument to be interpreted with full
331 support for multivalued RDNs. Example:
332 .Sp
333 \&\fI/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe\fR
334 .Sp
335 If \-multi\-rdn is not used then the \s-1UID\s0 value is \fI123456+CN=John Doe\fR.
336 .IP "\fB\-x509\fR" 4
337 .IX Item "-x509"
338 This option outputs a self signed certificate instead of a certificate
339 request. This is typically used to generate a test certificate or
340 a self signed root \s-1CA.\s0 The extensions added to the certificate
341 (if any) are specified in the configuration file. Unless specified
342 using the \fBset_serial\fR option, a large random number will be used for
343 the serial number.
344 .Sp
345 If existing request is specified with the \fB\-in\fR option, it is converted
346 to the self signed certificate otherwise new request is created.
347 .IP "\fB\-days n\fR" 4
348 .IX Item "-days n"
349 When the \fB\-x509\fR option is being used this specifies the number of
350 days to certify the certificate for, otherwise it is ignored. \fBn\fR should
351 be a positive integer. The default is 30 days.
352 .IP "\fB\-set_serial n\fR" 4
353 .IX Item "-set_serial n"
354 Serial number to use when outputting a self signed certificate. This
355 may be specified as a decimal value or a hex value if preceded by \fB0x\fR.
356 .IP "\fB\-addext ext\fR" 4
357 .IX Item "-addext ext"
358 Add a specific extension to the certificate (if the \fB\-x509\fR option is
359 present) or certificate request.  The argument must have the form of
360 a key=value pair as it would appear in a config file.
361 .Sp
362 This option can be given multiple times.
363 .IP "\fB\-extensions section\fR" 4
364 .IX Item "-extensions section"
365 .PD 0
366 .IP "\fB\-reqexts section\fR" 4
367 .IX Item "-reqexts section"
368 .PD
369 These options specify alternative sections to include certificate
370 extensions (if the \fB\-x509\fR option is present) or certificate
371 request extensions. This allows several different sections to
372 be used in the same configuration file to specify requests for
373 a variety of purposes.
374 .IP "\fB\-precert\fR" 4
375 .IX Item "-precert"
376 A poison extension will be added to the certificate, making it a
377 \&\*(L"pre-certificate\*(R" (see \s-1RFC6962\s0). This can be submitted to Certificate
378 Transparency logs in order to obtain signed certificate timestamps (SCTs).
379 These SCTs can then be embedded into the pre-certificate as an extension, before
380 removing the poison and signing the certificate.
381 .Sp
382 This implies the \fB\-new\fR flag.
383 .IP "\fB\-utf8\fR" 4
384 .IX Item "-utf8"
385 This option causes field values to be interpreted as \s-1UTF8\s0 strings, by
386 default they are interpreted as \s-1ASCII.\s0 This means that the field
387 values, whether prompted from a terminal or obtained from a
388 configuration file, must be valid \s-1UTF8\s0 strings.
389 .IP "\fB\-nameopt option\fR" 4
390 .IX Item "-nameopt option"
391 Option which determines how the subject or issuer names are displayed. The
392 \&\fBoption\fR argument can be a single option or multiple options separated by
393 commas.  Alternatively the \fB\-nameopt\fR switch may be used more than once to
394 set multiple options. See the \fIx509\fR\|(1) manual page for details.
395 .IP "\fB\-reqopt\fR" 4
396 .IX Item "-reqopt"
397 Customise the output format used with \fB\-text\fR. The \fBoption\fR argument can be
398 a single option or multiple options separated by commas.
399 .Sp
400 See discussion of the  \fB\-certopt\fR parameter in the \fIx509\fR\|(1)
401 command.
402 .IP "\fB\-newhdr\fR" 4
403 .IX Item "-newhdr"
404 Adds the word \fB\s-1NEW\s0\fR to the \s-1PEM\s0 file header and footer lines on the outputted
405 request. Some software (Netscape certificate server) and some CAs need this.
406 .IP "\fB\-batch\fR" 4
407 .IX Item "-batch"
408 Non-interactive mode.
409 .IP "\fB\-verbose\fR" 4
410 .IX Item "-verbose"
411 Print extra details about the operations being performed.
412 .IP "\fB\-engine id\fR" 4
413 .IX Item "-engine id"
414 Specifying an engine (by its unique \fBid\fR string) will cause \fBreq\fR
415 to attempt to obtain a functional reference to the specified engine,
416 thus initialising it if needed. The engine will then be set as the default
417 for all available algorithms.
418 .IP "\fB\-keygen_engine id\fR" 4
419 .IX Item "-keygen_engine id"
420 Specifies an engine (by its unique \fBid\fR string) which would be used
421 for key generation operations.
422 .SH "CONFIGURATION FILE FORMAT"
423 .IX Header "CONFIGURATION FILE FORMAT"
424 The configuration options are specified in the \fBreq\fR section of
425 the configuration file. As with all configuration files if no
426 value is specified in the specific section (i.e. \fBreq\fR) then
427 the initial unnamed or \fBdefault\fR section is searched too.
428 .PP
429 The options available are described in detail below.
430 .IP "\fBinput_password output_password\fR" 4
431 .IX Item "input_password output_password"
432 The passwords for the input private key file (if present) and
433 the output private key file (if one will be created). The
434 command line options \fBpassin\fR and \fBpassout\fR override the
435 configuration file values.
436 .IP "\fBdefault_bits\fR" 4
437 .IX Item "default_bits"
438 Specifies the default key size in bits.
439 .Sp
440 This option is used in conjunction with the \fB\-new\fR option to generate
441 a new key. It can be overridden by specifying an explicit key size in
442 the \fB\-newkey\fR option. The smallest accepted key size is 512 bits. If
443 no key size is specified then 2048 bits is used.
444 .IP "\fBdefault_keyfile\fR" 4
445 .IX Item "default_keyfile"
446 This is the default filename to write a private key to. If not
447 specified the key is written to standard output. This can be
448 overridden by the \fB\-keyout\fR option.
449 .IP "\fBoid_file\fR" 4
450 .IX Item "oid_file"
451 This specifies a file containing additional \fB\s-1OBJECT IDENTIFIERS\s0\fR.
452 Each line of the file should consist of the numerical form of the
453 object identifier followed by white space then the short name followed
454 by white space and finally the long name.
455 .IP "\fBoid_section\fR" 4
456 .IX Item "oid_section"
457 This specifies a section in the configuration file containing extra
458 object identifiers. Each line should consist of the short name of the
459 object identifier followed by \fB=\fR and the numerical form. The short
460 and long names are the same when this option is used.
461 .IP "\fB\s-1RANDFILE\s0\fR" 4
462 .IX Item "RANDFILE"
463 At startup the specified file is loaded into the random number generator,
464 and at exit 256 bytes will be written to it.
465 It is used for private key generation.
466 .IP "\fBencrypt_key\fR" 4
467 .IX Item "encrypt_key"
468 If this is set to \fBno\fR then if a private key is generated it is
469 \&\fBnot\fR encrypted. This is equivalent to the \fB\-nodes\fR command line
470 option. For compatibility \fBencrypt_rsa_key\fR is an equivalent option.
471 .IP "\fBdefault_md\fR" 4
472 .IX Item "default_md"
473 This option specifies the digest algorithm to use. Any digest supported by the
474 OpenSSL \fBdgst\fR command can be used. This option can be overridden on the
475 command line. Certain signing algorithms (i.e. Ed25519 and Ed448) will ignore
476 any digest that has been set.
477 .IP "\fBstring_mask\fR" 4
478 .IX Item "string_mask"
479 This option masks out the use of certain string types in certain
480 fields. Most users will not need to change this option.
481 .Sp
482 It can be set to several values \fBdefault\fR which is also the default
483 option uses PrintableStrings, T61Strings and BMPStrings if the
484 \&\fBpkix\fR value is used then only PrintableStrings and BMPStrings will
485 be used. This follows the \s-1PKIX\s0 recommendation in \s-1RFC2459.\s0 If the
486 \&\fButf8only\fR option is used then only UTF8Strings will be used: this
487 is the \s-1PKIX\s0 recommendation in \s-1RFC2459\s0 after 2003. Finally the \fBnombstr\fR
488 option just uses PrintableStrings and T61Strings: certain software has
489 problems with BMPStrings and UTF8Strings: in particular Netscape.
490 .IP "\fBreq_extensions\fR" 4
491 .IX Item "req_extensions"
492 This specifies the configuration file section containing a list of
493 extensions to add to the certificate request. It can be overridden
494 by the \fB\-reqexts\fR command line switch. See the
495 \&\fIx509v3_config\fR\|(5) manual page for details of the
496 extension section format.
497 .IP "\fBx509_extensions\fR" 4
498 .IX Item "x509_extensions"
499 This specifies the configuration file section containing a list of
500 extensions to add to certificate generated when the \fB\-x509\fR switch
501 is used. It can be overridden by the \fB\-extensions\fR command line switch.
502 .IP "\fBprompt\fR" 4
503 .IX Item "prompt"
504 If set to the value \fBno\fR this disables prompting of certificate fields
505 and just takes values from the config file directly. It also changes the
506 expected format of the \fBdistinguished_name\fR and \fBattributes\fR sections.
507 .IP "\fButf8\fR" 4
508 .IX Item "utf8"
509 If set to the value \fByes\fR then field values to be interpreted as \s-1UTF8\s0
510 strings, by default they are interpreted as \s-1ASCII.\s0 This means that
511 the field values, whether prompted from a terminal or obtained from a
512 configuration file, must be valid \s-1UTF8\s0 strings.
513 .IP "\fBattributes\fR" 4
514 .IX Item "attributes"
515 This specifies the section containing any request attributes: its format
516 is the same as \fBdistinguished_name\fR. Typically these may contain the
517 challengePassword or unstructuredName types. They are currently ignored
518 by OpenSSL's request signing utilities but some CAs might want them.
519 .IP "\fBdistinguished_name\fR" 4
520 .IX Item "distinguished_name"
521 This specifies the section containing the distinguished name fields to
522 prompt for when generating a certificate or certificate request. The format
523 is described in the next section.
524 .SH "DISTINGUISHED NAME AND ATTRIBUTE SECTION FORMAT"
525 .IX Header "DISTINGUISHED NAME AND ATTRIBUTE SECTION FORMAT"
526 There are two separate formats for the distinguished name and attribute
527 sections. If the \fBprompt\fR option is set to \fBno\fR then these sections
528 just consist of field names and values: for example,
529 .PP
530 .Vb 3
531 \& CN=My Name
532 \& OU=My Organization
533 \& emailAddress=someone@somewhere.org
534 .Ve
535 .PP
536 This allows external programs (e.g. \s-1GUI\s0 based) to generate a template file
537 with all the field names and values and just pass it to \fBreq\fR. An example
538 of this kind of configuration file is contained in the \fB\s-1EXAMPLES\s0\fR section.
539 .PP
540 Alternatively if the \fBprompt\fR option is absent or not set to \fBno\fR then the
541 file contains field prompting information. It consists of lines of the form:
542 .PP
543 .Vb 4
544 \& fieldName="prompt"
545 \& fieldName_default="default field value"
546 \& fieldName_min= 2
547 \& fieldName_max= 4
548 .Ve
549 .PP
550 \&\*(L"fieldName\*(R" is the field name being used, for example commonName (or \s-1CN\s0).
551 The \*(L"prompt\*(R" string is used to ask the user to enter the relevant
552 details. If the user enters nothing then the default value is used if no
553 default value is present then the field is omitted. A field can
554 still be omitted if a default value is present if the user just
555 enters the '.' character.
556 .PP
557 The number of characters entered must be between the fieldName_min and
558 fieldName_max limits: there may be additional restrictions based
559 on the field being used (for example countryName can only ever be
560 two characters long and must fit in a PrintableString).
561 .PP
562 Some fields (such as organizationName) can be used more than once
563 in a \s-1DN.\s0 This presents a problem because configuration files will
564 not recognize the same name occurring twice. To avoid this problem
565 if the fieldName contains some characters followed by a full stop
566 they will be ignored. So for example a second organizationName can
567 be input by calling it \*(L"1.organizationName\*(R".
568 .PP
569 The actual permitted field names are any object identifier short or
570 long names. These are compiled into OpenSSL and include the usual
571 values such as commonName, countryName, localityName, organizationName,
572 organizationalUnitName, stateOrProvinceName. Additionally emailAddress
573 is include as well as name, surname, givenName initials and dnQualifier.
574 .PP
575 Additional object identifiers can be defined with the \fBoid_file\fR or
576 \&\fBoid_section\fR options in the configuration file. Any additional fields
577 will be treated as though they were a DirectoryString.
578 .SH "EXAMPLES"
579 .IX Header "EXAMPLES"
580 Examine and verify certificate request:
581 .PP
582 .Vb 1
583 \& openssl req \-in req.pem \-text \-verify \-noout
584 .Ve
585 .PP
586 Create a private key and then generate a certificate request from it:
587 .PP
588 .Vb 2
589 \& openssl genrsa \-out key.pem 2048
590 \& openssl req \-new \-key key.pem \-out req.pem
591 .Ve
592 .PP
593 The same but just using req:
594 .PP
595 .Vb 1
596 \& openssl req \-newkey rsa:2048 \-keyout key.pem \-out req.pem
597 .Ve
598 .PP
599 Generate a self signed root certificate:
600 .PP
601 .Vb 1
602 \& openssl req \-x509 \-newkey rsa:2048 \-keyout key.pem \-out req.pem
603 .Ve
604 .PP
605 Example of a file pointed to by the \fBoid_file\fR option:
606 .PP
607 .Vb 2
608 \& 1.2.3.4        shortName       A longer Name
609 \& 1.2.3.6        otherName       Other longer Name
610 .Ve
611 .PP
612 Example of a section pointed to by \fBoid_section\fR making use of variable
613 expansion:
614 .PP
615 .Vb 2
616 \& testoid1=1.2.3.5
617 \& testoid2=${testoid1}.6
618 .Ve
619 .PP
620 Sample configuration file prompting for field values:
621 .PP
622 .Vb 6
623 \& [ req ]
624 \& default_bits           = 2048
625 \& default_keyfile        = privkey.pem
626 \& distinguished_name     = req_distinguished_name
627 \& attributes             = req_attributes
628 \& req_extensions         = v3_ca
629 \&
630 \& dirstring_type = nobmp
631 \&
632 \& [ req_distinguished_name ]
633 \& countryName                    = Country Name (2 letter code)
634 \& countryName_default            = AU
635 \& countryName_min                = 2
636 \& countryName_max                = 2
637 \&
638 \& localityName                   = Locality Name (eg, city)
639 \&
640 \& organizationalUnitName         = Organizational Unit Name (eg, section)
641 \&
642 \& commonName                     = Common Name (eg, YOUR name)
643 \& commonName_max                 = 64
644 \&
645 \& emailAddress                   = Email Address
646 \& emailAddress_max               = 40
647 \&
648 \& [ req_attributes ]
649 \& challengePassword              = A challenge password
650 \& challengePassword_min          = 4
651 \& challengePassword_max          = 20
652 \&
653 \& [ v3_ca ]
654 \&
655 \& subjectKeyIdentifier=hash
656 \& authorityKeyIdentifier=keyid:always,issuer:always
657 \& basicConstraints = critical, CA:true
658 .Ve
659 .PP
660 Sample configuration containing all field values:
661 .PP
662 .Vb 1
663 \& RANDFILE               = $ENV::HOME/.rnd
664 \&
665 \& [ req ]
666 \& default_bits           = 2048
667 \& default_keyfile        = keyfile.pem
668 \& distinguished_name     = req_distinguished_name
669 \& attributes             = req_attributes
670 \& prompt                 = no
671 \& output_password        = mypass
672 \&
673 \& [ req_distinguished_name ]
674 \& C                      = GB
675 \& ST                     = Test State or Province
676 \& L                      = Test Locality
677 \& O                      = Organization Name
678 \& OU                     = Organizational Unit Name
679 \& CN                     = Common Name
680 \& emailAddress           = test@email.address
681 \&
682 \& [ req_attributes ]
683 \& challengePassword              = A challenge password
684 .Ve
685 .PP
686 Example of giving the most common attributes (subject and extensions)
687 on the command line:
688 .PP
689 .Vb 4
690 \& openssl req \-new \-subj "/C=GB/CN=foo" \e
691 \&                  \-addext "subjectAltName = DNS:foo.co.uk" \e
692 \&                  \-addext "certificatePolicies = 1.2.3.4" \e
693 \&                  \-newkey rsa:2048 \-keyout key.pem \-out req.pem
694 .Ve
695 .SH "NOTES"
696 .IX Header "NOTES"
697 The header and footer lines in the \fB\s-1PEM\s0\fR format are normally:
698 .PP
699 .Vb 2
700 \& \-\-\-\-\-BEGIN CERTIFICATE REQUEST\-\-\-\-\-
701 \& \-\-\-\-\-END CERTIFICATE REQUEST\-\-\-\-\-
702 .Ve
703 .PP
704 some software (some versions of Netscape certificate server) instead needs:
705 .PP
706 .Vb 2
707 \& \-\-\-\-\-BEGIN NEW CERTIFICATE REQUEST\-\-\-\-\-
708 \& \-\-\-\-\-END NEW CERTIFICATE REQUEST\-\-\-\-\-
709 .Ve
710 .PP
711 which is produced with the \fB\-newhdr\fR option but is otherwise compatible.
712 Either form is accepted transparently on input.
713 .PP
714 The certificate requests generated by \fBXenroll\fR with \s-1MSIE\s0 have extensions
715 added. It includes the \fBkeyUsage\fR extension which determines the type of
716 key (signature only or general purpose) and any additional OIDs entered
717 by the script in an extendedKeyUsage extension.
718 .SH "DIAGNOSTICS"
719 .IX Header "DIAGNOSTICS"
720 The following messages are frequently asked about:
721 .PP
722 .Vb 2
723 \&        Using configuration from /some/path/openssl.cnf
724 \&        Unable to load config info
725 .Ve
726 .PP
727 This is followed some time later by...
728 .PP
729 .Vb 2
730 \&        unable to find \*(Aqdistinguished_name\*(Aq in config
731 \&        problems making Certificate Request
732 .Ve
733 .PP
734 The first error message is the clue: it can't find the configuration
735 file! Certain operations (like examining a certificate request) don't
736 need a configuration file so its use isn't enforced. Generation of
737 certificates or requests however does need a configuration file. This
738 could be regarded as a bug.
739 .PP
740 Another puzzling message is this:
741 .PP
742 .Vb 2
743 \&        Attributes:
744 \&            a0:00
745 .Ve
746 .PP
747 this is displayed when no attributes are present and the request includes
748 the correct empty \fB\s-1SET OF\s0\fR structure (the \s-1DER\s0 encoding of which is 0xa0
749 0x00). If you just see:
750 .PP
751 .Vb 1
752 \&        Attributes:
753 .Ve
754 .PP
755 then the \fB\s-1SET OF\s0\fR is missing and the encoding is technically invalid (but
756 it is tolerated). See the description of the command line option \fB\-asn1\-kludge\fR
757 for more information.
758 .SH "BUGS"
759 .IX Header "BUGS"
760 OpenSSL's handling of T61Strings (aka TeletexStrings) is broken: it effectively
761 treats them as \s-1ISO\-8859\-1\s0 (Latin 1), Netscape and \s-1MSIE\s0 have similar behaviour.
762 This can cause problems if you need characters that aren't available in
763 PrintableStrings and you don't want to or can't use BMPStrings.
764 .PP
765 As a consequence of the T61String handling the only correct way to represent
766 accented characters in OpenSSL is to use a BMPString: unfortunately Netscape
767 currently chokes on these. If you have to use accented characters with Netscape
768 and \s-1MSIE\s0 then you currently need to use the invalid T61String form.
769 .PP
770 The current prompting is not very friendly. It doesn't allow you to confirm what
771 you've just entered. Other things like extensions in certificate requests are
772 statically defined in the configuration file. Some of these: like an email
773 address in subjectAltName should be input by the user.
774 .SH "SEE ALSO"
775 .IX Header "SEE ALSO"
776 \&\fIx509\fR\|(1), \fIca\fR\|(1), \fIgenrsa\fR\|(1),
777 \&\fIgendsa\fR\|(1), \fIconfig\fR\|(5),
778 \&\fIx509v3_config\fR\|(5)
779 .SH "COPYRIGHT"
780 .IX Header "COPYRIGHT"
781 Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
782 .PP
783 Licensed under the OpenSSL license (the \*(L"License\*(R").  You may not use
784 this file except in compliance with the License.  You can obtain a copy
785 in the file \s-1LICENSE\s0 in the source distribution or at
786 <https://www.openssl.org/source/license.html>.