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