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