Merge branch 'vendor/OPENSSL'
[dragonfly.git] / secure / usr.bin / openssl / man / ca.1
1 .\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sh \" Subsection heading
6 .br
7 .if t .Sp
8 .ne 5
9 .PP
10 \fB\\$1\fR
11 .PP
12 ..
13 .de Sp \" Vertical space (when we can't use .PP)
14 .if t .sp .5v
15 .if n .sp
16 ..
17 .de Vb \" Begin verbatim text
18 .ft CW
19 .nf
20 .ne \\$1
21 ..
22 .de Ve \" End verbatim text
23 .ft R
24 .fi
25 ..
26 .\" Set up some character translations and predefined strings.  \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
29 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
30 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
31 .\" nothing in troff, for use with C<>.
32 .tr \(*W-
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34 .ie n \{\
35 .    ds -- \(*W-
36 .    ds PI pi
37 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
39 .    ds L" ""
40 .    ds R" ""
41 .    ds C` ""
42 .    ds C' ""
43 'br\}
44 .el\{\
45 .    ds -- \|\(em\|
46 .    ds PI \(*p
47 .    ds L" ``
48 .    ds R" ''
49 'br\}
50 .\"
51 .\" Escape single quotes in literal strings from groff's Unicode transform.
52 .ie \n(.g .ds Aq \(aq
53 .el       .ds Aq '
54 .\"
55 .\" If the F register is turned on, we'll generate index entries on stderr for
56 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
57 .\" entries marked with X<> in POD.  Of course, you'll have to process the
58 .\" output yourself in some meaningful fashion.
59 .ie \nF \{\
60 .    de IX
61 .    tm Index:\\$1\t\\n%\t"\\$2"
62 ..
63 .    nr % 0
64 .    rr F
65 .\}
66 .el \{\
67 .    de IX
68 ..
69 .\}
70 .\"
71 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
72 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
73 .    \" fudge factors for nroff and troff
74 .if n \{\
75 .    ds #H 0
76 .    ds #V .8m
77 .    ds #F .3m
78 .    ds #[ \f1
79 .    ds #] \fP
80 .\}
81 .if t \{\
82 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
83 .    ds #V .6m
84 .    ds #F 0
85 .    ds #[ \&
86 .    ds #] \&
87 .\}
88 .    \" simple accents for nroff and troff
89 .if n \{\
90 .    ds ' \&
91 .    ds ` \&
92 .    ds ^ \&
93 .    ds , \&
94 .    ds ~ ~
95 .    ds /
96 .\}
97 .if t \{\
98 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
99 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
100 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
101 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
102 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
103 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
104 .\}
105 .    \" troff and (daisy-wheel) nroff accents
106 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
107 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
108 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
109 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
110 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
111 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
112 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
113 .ds ae a\h'-(\w'a'u*4/10)'e
114 .ds Ae A\h'-(\w'A'u*4/10)'E
115 .    \" corrections for vroff
116 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
117 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
118 .    \" for low resolution devices (crt and lpr)
119 .if \n(.H>23 .if \n(.V>19 \
120 \{\
121 .    ds : e
122 .    ds 8 ss
123 .    ds o a
124 .    ds d- d\h'-1'\(ga
125 .    ds D- D\h'-1'\(hy
126 .    ds th \o'bp'
127 .    ds Th \o'LP'
128 .    ds ae ae
129 .    ds Ae AE
130 .\}
131 .rm #[ #] #H #V #F C
132 .\" ========================================================================
133 .\"
134 .IX Title "CA 1"
135 .TH CA 1 "2009-04-11" "0.9.8k" "OpenSSL"
136 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
137 .\" way too many mistakes in technical documents.
138 .if n .ad l
139 .nh
140 .SH "NAME"
141 ca \- sample minimal CA application
142 .SH "SYNOPSIS"
143 .IX Header "SYNOPSIS"
144 \&\fBopenssl\fR \fBca\fR
145 [\fB\-verbose\fR]
146 [\fB\-config filename\fR]
147 [\fB\-name section\fR]
148 [\fB\-gencrl\fR]
149 [\fB\-revoke file\fR]
150 [\fB\-crl_reason reason\fR]
151 [\fB\-crl_hold instruction\fR]
152 [\fB\-crl_compromise time\fR]
153 [\fB\-crl_CA_compromise time\fR]
154 [\fB\-crldays days\fR]
155 [\fB\-crlhours hours\fR]
156 [\fB\-crlexts section\fR]
157 [\fB\-startdate date\fR]
158 [\fB\-enddate date\fR]
159 [\fB\-days arg\fR]
160 [\fB\-md arg\fR]
161 [\fB\-policy arg\fR]
162 [\fB\-keyfile arg\fR]
163 [\fB\-key arg\fR]
164 [\fB\-passin arg\fR]
165 [\fB\-cert file\fR]
166 [\fB\-selfsign\fR]
167 [\fB\-in file\fR]
168 [\fB\-out file\fR]
169 [\fB\-notext\fR]
170 [\fB\-outdir dir\fR]
171 [\fB\-infiles\fR]
172 [\fB\-spkac file\fR]
173 [\fB\-ss_cert file\fR]
174 [\fB\-preserveDN\fR]
175 [\fB\-noemailDN\fR]
176 [\fB\-batch\fR]
177 [\fB\-msie_hack\fR]
178 [\fB\-extensions section\fR]
179 [\fB\-extfile section\fR]
180 [\fB\-engine id\fR]
181 [\fB\-subj arg\fR]
182 [\fB\-utf8\fR]
183 [\fB\-multivalue\-rdn\fR]
184 .SH "DESCRIPTION"
185 .IX Header "DESCRIPTION"
186 The \fBca\fR command is a minimal \s-1CA\s0 application. It can be used
187 to sign certificate requests in a variety of forms and generate
188 CRLs it also maintains a text database of issued certificates
189 and their status.
190 .PP
191 The options descriptions will be divided into each purpose.
192 .SH "CA OPTIONS"
193 .IX Header "CA OPTIONS"
194 .IP "\fB\-config filename\fR" 4
195 .IX Item "-config filename"
196 specifies the configuration file to use.
197 .IP "\fB\-name section\fR" 4
198 .IX Item "-name section"
199 specifies the configuration file section to use (overrides
200 \&\fBdefault_ca\fR in the \fBca\fR section).
201 .IP "\fB\-in filename\fR" 4
202 .IX Item "-in filename"
203 an input filename containing a single certificate request to be
204 signed by the \s-1CA\s0.
205 .IP "\fB\-ss_cert filename\fR" 4
206 .IX Item "-ss_cert filename"
207 a single self signed certificate to be signed by the \s-1CA\s0.
208 .IP "\fB\-spkac filename\fR" 4
209 .IX Item "-spkac filename"
210 a file containing a single Netscape signed public key and challenge
211 and additional field values to be signed by the \s-1CA\s0. See the \fB\s-1SPKAC\s0 \s-1FORMAT\s0\fR
212 section for information on the required format.
213 .IP "\fB\-infiles\fR" 4
214 .IX Item "-infiles"
215 if present this should be the last option, all subsequent arguments
216 are assumed to the the names of files containing certificate requests.
217 .IP "\fB\-out filename\fR" 4
218 .IX Item "-out filename"
219 the output file to output certificates to. The default is standard
220 output. The certificate details will also be printed out to this
221 file.
222 .IP "\fB\-outdir directory\fR" 4
223 .IX Item "-outdir directory"
224 the directory to output certificates to. The certificate will be
225 written to a filename consisting of the serial number in hex with
226 \&\*(L".pem\*(R" appended.
227 .IP "\fB\-cert\fR" 4
228 .IX Item "-cert"
229 the \s-1CA\s0 certificate file.
230 .IP "\fB\-keyfile filename\fR" 4
231 .IX Item "-keyfile filename"
232 the private key to sign requests with.
233 .IP "\fB\-key password\fR" 4
234 .IX Item "-key password"
235 the password used to encrypt the private key. Since on some
236 systems the command line arguments are visible (e.g. Unix with
237 the 'ps' utility) this option should be used with caution.
238 .IP "\fB\-selfsign\fR" 4
239 .IX Item "-selfsign"
240 indicates the issued certificates are to be signed with the key
241 the certificate requests were signed with (given with \fB\-keyfile\fR).
242 Cerificate requests signed with a different key are ignored.  If
243 \&\fB\-spkac\fR, \fB\-ss_cert\fR or \fB\-gencrl\fR are given, \fB\-selfsign\fR is
244 ignored.
245 .Sp
246 A consequence of using \fB\-selfsign\fR is that the self-signed
247 certificate appears among the entries in the certificate database
248 (see the configuration option \fBdatabase\fR), and uses the same
249 serial number counter as all other certificates sign with the
250 self-signed certificate.
251 .IP "\fB\-passin arg\fR" 4
252 .IX Item "-passin arg"
253 the key password source. For more information about the format of \fBarg\fR
254 see the \fB\s-1PASS\s0 \s-1PHRASE\s0 \s-1ARGUMENTS\s0\fR section in \fIopenssl\fR\|(1).
255 .IP "\fB\-verbose\fR" 4
256 .IX Item "-verbose"
257 this prints extra details about the operations being performed.
258 .IP "\fB\-notext\fR" 4
259 .IX Item "-notext"
260 don't output the text form of a certificate to the output file.
261 .IP "\fB\-startdate date\fR" 4
262 .IX Item "-startdate date"
263 this allows the start date to be explicitly set. The format of the
264 date is \s-1YYMMDDHHMMSSZ\s0 (the same as an \s-1ASN1\s0 UTCTime structure).
265 .IP "\fB\-enddate date\fR" 4
266 .IX Item "-enddate date"
267 this allows the expiry date to be explicitly set. The format of the
268 date is \s-1YYMMDDHHMMSSZ\s0 (the same as an \s-1ASN1\s0 UTCTime structure).
269 .IP "\fB\-days arg\fR" 4
270 .IX Item "-days arg"
271 the number of days to certify the certificate for.
272 .IP "\fB\-md alg\fR" 4
273 .IX Item "-md alg"
274 the message digest to use. Possible values include md5, sha1 and mdc2.
275 This option also applies to CRLs.
276 .IP "\fB\-policy arg\fR" 4
277 .IX Item "-policy arg"
278 this option defines the \s-1CA\s0 \*(L"policy\*(R" to use. This is a section in
279 the configuration file which decides which fields should be mandatory
280 or match the \s-1CA\s0 certificate. Check out the \fB\s-1POLICY\s0 \s-1FORMAT\s0\fR section
281 for more information.
282 .IP "\fB\-msie_hack\fR" 4
283 .IX Item "-msie_hack"
284 this is a legacy option to make \fBca\fR work with very old versions of
285 the \s-1IE\s0 certificate enrollment control \*(L"certenr3\*(R". It used UniversalStrings
286 for almost everything. Since the old control has various security bugs
287 its use is strongly discouraged. The newer control \*(L"Xenroll\*(R" does not
288 need this option.
289 .IP "\fB\-preserveDN\fR" 4
290 .IX Item "-preserveDN"
291 Normally the \s-1DN\s0 order of a certificate is the same as the order of the
292 fields in the relevant policy section. When this option is set the order 
293 is the same as the request. This is largely for compatibility with the
294 older \s-1IE\s0 enrollment control which would only accept certificates if their
295 DNs match the order of the request. This is not needed for Xenroll.
296 .IP "\fB\-noemailDN\fR" 4
297 .IX Item "-noemailDN"
298 The \s-1DN\s0 of a certificate can contain the \s-1EMAIL\s0 field if present in the
299 request \s-1DN\s0, however it is good policy just having the e\-mail set into
300 the altName extension of the certificate. When this option is set the
301 \&\s-1EMAIL\s0 field is removed from the certificate' subject and set only in
302 the, eventually present, extensions. The \fBemail_in_dn\fR keyword can be
303 used in the configuration file to enable this behaviour.
304 .IP "\fB\-batch\fR" 4
305 .IX Item "-batch"
306 this sets the batch mode. In this mode no questions will be asked
307 and all certificates will be certified automatically.
308 .IP "\fB\-extensions section\fR" 4
309 .IX Item "-extensions section"
310 the section of the configuration file containing certificate extensions
311 to be added when a certificate is issued (defaults to \fBx509_extensions\fR
312 unless the \fB\-extfile\fR option is used). If no extension section is
313 present then, a V1 certificate is created. If the extension section
314 is present (even if it is empty), then a V3 certificate is created.
315 .IP "\fB\-extfile file\fR" 4
316 .IX Item "-extfile file"
317 an additional configuration file to read certificate extensions from
318 (using the default section unless the \fB\-extensions\fR option is also
319 used).
320 .IP "\fB\-engine id\fR" 4
321 .IX Item "-engine id"
322 specifying an engine (by it's unique \fBid\fR string) will cause \fBreq\fR
323 to attempt to obtain a functional reference to the specified engine,
324 thus initialising it if needed. The engine will then be set as the default
325 for all available algorithms.
326 .IP "\fB\-subj arg\fR" 4
327 .IX Item "-subj arg"
328 supersedes subject name given in the request.
329 The arg must be formatted as \fI/type0=value0/type1=value1/type2=...\fR,
330 characters may be escaped by \e (backslash), no spaces are skipped.
331 .IP "\fB\-utf8\fR" 4
332 .IX Item "-utf8"
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\-multivalue\-rdn\fR" 4
338 .IX Item "-multivalue-rdn"
339 this option causes the \-subj argument to be interpretedt with full
340 support for multivalued RDNs. Example:
341 .Sp
342 \&\fI/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe\fR
343 .Sp
344 If \-multi\-rdn is not used then the \s-1UID\s0 value is \fI123456+CN=John Doe\fR.
345 .SH "CRL OPTIONS"
346 .IX Header "CRL OPTIONS"
347 .IP "\fB\-gencrl\fR" 4
348 .IX Item "-gencrl"
349 this option generates a \s-1CRL\s0 based on information in the index file.
350 .IP "\fB\-crldays num\fR" 4
351 .IX Item "-crldays num"
352 the number of days before the next \s-1CRL\s0 is due. That is the days from
353 now to place in the \s-1CRL\s0 nextUpdate field.
354 .IP "\fB\-crlhours num\fR" 4
355 .IX Item "-crlhours num"
356 the number of hours before the next \s-1CRL\s0 is due.
357 .IP "\fB\-revoke filename\fR" 4
358 .IX Item "-revoke filename"
359 a filename containing a certificate to revoke.
360 .IP "\fB\-crl_reason reason\fR" 4
361 .IX Item "-crl_reason reason"
362 revocation reason, where \fBreason\fR is one of: \fBunspecified\fR, \fBkeyCompromise\fR,
363 \&\fBCACompromise\fR, \fBaffiliationChanged\fR, \fBsuperseded\fR, \fBcessationOfOperation\fR,
364 \&\fBcertificateHold\fR or \fBremoveFromCRL\fR. The matching of \fBreason\fR is case
365 insensitive. Setting any revocation reason will make the \s-1CRL\s0 v2.
366 .Sp
367 In practive \fBremoveFromCRL\fR is not particularly useful because it is only used
368 in delta CRLs which are not currently implemented.
369 .IP "\fB\-crl_hold instruction\fR" 4
370 .IX Item "-crl_hold instruction"
371 This sets the \s-1CRL\s0 revocation reason code to \fBcertificateHold\fR and the hold
372 instruction to \fBinstruction\fR which must be an \s-1OID\s0. Although any \s-1OID\s0 can be
373 used only \fBholdInstructionNone\fR (the use of which is discouraged by \s-1RFC2459\s0)
374 \&\fBholdInstructionCallIssuer\fR or \fBholdInstructionReject\fR will normally be used.
375 .IP "\fB\-crl_compromise time\fR" 4
376 .IX Item "-crl_compromise time"
377 This sets the revocation reason to \fBkeyCompromise\fR and the compromise time to
378 \&\fBtime\fR. \fBtime\fR should be in GeneralizedTime format that is \fB\s-1YYYYMMDDHHMMSSZ\s0\fR.
379 .IP "\fB\-crl_CA_compromise time\fR" 4
380 .IX Item "-crl_CA_compromise time"
381 This is the same as \fBcrl_compromise\fR except the revocation reason is set to
382 \&\fBCACompromise\fR.
383 .IP "\fB\-crlexts section\fR" 4
384 .IX Item "-crlexts section"
385 the section of the configuration file containing \s-1CRL\s0 extensions to
386 include. If no \s-1CRL\s0 extension section is present then a V1 \s-1CRL\s0 is
387 created, if the \s-1CRL\s0 extension section is present (even if it is
388 empty) then a V2 \s-1CRL\s0 is created. The \s-1CRL\s0 extensions specified are
389 \&\s-1CRL\s0 extensions and \fBnot\fR \s-1CRL\s0 entry extensions.  It should be noted
390 that some software (for example Netscape) can't handle V2 CRLs.
391 .SH "CONFIGURATION FILE OPTIONS"
392 .IX Header "CONFIGURATION FILE OPTIONS"
393 The section of the configuration file containing options for \fBca\fR
394 is found as follows: If the \fB\-name\fR command line option is used,
395 then it names the section to be used. Otherwise the section to
396 be used must be named in the \fBdefault_ca\fR option of the \fBca\fR section
397 of the configuration file (or in the default section of the
398 configuration file). Besides \fBdefault_ca\fR, the following options are
399 read directly from the \fBca\fR section:
400  \s-1RANDFILE\s0
401  preserve
402  msie_hack
403 With the exception of \fB\s-1RANDFILE\s0\fR, this is probably a bug and may
404 change in future releases.
405 .PP
406 Many of the configuration file options are identical to command line
407 options. Where the option is present in the configuration file
408 and the command line the command line value is used. Where an
409 option is described as mandatory then it must be present in
410 the configuration file or the command line equivalent (if
411 any) used.
412 .IP "\fBoid_file\fR" 4
413 .IX Item "oid_file"
414 This specifies a file containing additional \fB\s-1OBJECT\s0 \s-1IDENTIFIERS\s0\fR.
415 Each line of the file should consist of the numerical form of the
416 object identifier followed by white space then the short name followed
417 by white space and finally the long name.
418 .IP "\fBoid_section\fR" 4
419 .IX Item "oid_section"
420 This specifies a section in the configuration file containing extra
421 object identifiers. Each line should consist of the short name of the
422 object identifier followed by \fB=\fR and the numerical form. The short
423 and long names are the same when this option is used.
424 .IP "\fBnew_certs_dir\fR" 4
425 .IX Item "new_certs_dir"
426 the same as the \fB\-outdir\fR command line option. It specifies
427 the directory where new certificates will be placed. Mandatory.
428 .IP "\fBcertificate\fR" 4
429 .IX Item "certificate"
430 the same as \fB\-cert\fR. It gives the file containing the \s-1CA\s0
431 certificate. Mandatory.
432 .IP "\fBprivate_key\fR" 4
433 .IX Item "private_key"
434 same as the \fB\-keyfile\fR option. The file containing the
435 \&\s-1CA\s0 private key. Mandatory.
436 .IP "\fB\s-1RANDFILE\s0\fR" 4
437 .IX Item "RANDFILE"
438 a file used to read and write random number seed information, or
439 an \s-1EGD\s0 socket (see \fIRAND_egd\fR\|(3)).
440 .IP "\fBdefault_days\fR" 4
441 .IX Item "default_days"
442 the same as the \fB\-days\fR option. The number of days to certify
443 a certificate for.
444 .IP "\fBdefault_startdate\fR" 4
445 .IX Item "default_startdate"
446 the same as the \fB\-startdate\fR option. The start date to certify
447 a certificate for. If not set the current time is used.
448 .IP "\fBdefault_enddate\fR" 4
449 .IX Item "default_enddate"
450 the same as the \fB\-enddate\fR option. Either this option or
451 \&\fBdefault_days\fR (or the command line equivalents) must be
452 present.
453 .IP "\fBdefault_crl_hours default_crl_days\fR" 4
454 .IX Item "default_crl_hours default_crl_days"
455 the same as the \fB\-crlhours\fR and the \fB\-crldays\fR options. These
456 will only be used if neither command line option is present. At
457 least one of these must be present to generate a \s-1CRL\s0.
458 .IP "\fBdefault_md\fR" 4
459 .IX Item "default_md"
460 the same as the \fB\-md\fR option. The message digest to use. Mandatory.
461 .IP "\fBdatabase\fR" 4
462 .IX Item "database"
463 the text database file to use. Mandatory. This file must be present
464 though initially it will be empty.
465 .IP "\fBunique_subject\fR" 4
466 .IX Item "unique_subject"
467 if the value \fByes\fR is given, the valid certificate entries in the
468 database must have unique subjects.  if the value \fBno\fR is given,
469 several valid certificate entries may have the exact same subject.
470 The default value is \fByes\fR, to be compatible with older (pre 0.9.8)
471 versions of OpenSSL.  However, to make \s-1CA\s0 certificate roll-over easier,
472 it's recommended to use the value \fBno\fR, especially if combined with
473 the \fB\-selfsign\fR command line option.
474 .IP "\fBserial\fR" 4
475 .IX Item "serial"
476 a text file containing the next serial number to use in hex. Mandatory.
477 This file must be present and contain a valid serial number.
478 .IP "\fBcrlnumber\fR" 4
479 .IX Item "crlnumber"
480 a text file containing the next \s-1CRL\s0 number to use in hex. The crl number
481 will be inserted in the CRLs only if this file exists. If this file is
482 present, it must contain a valid \s-1CRL\s0 number.
483 .IP "\fBx509_extensions\fR" 4
484 .IX Item "x509_extensions"
485 the same as \fB\-extensions\fR.
486 .IP "\fBcrl_extensions\fR" 4
487 .IX Item "crl_extensions"
488 the same as \fB\-crlexts\fR.
489 .IP "\fBpreserve\fR" 4
490 .IX Item "preserve"
491 the same as \fB\-preserveDN\fR
492 .IP "\fBemail_in_dn\fR" 4
493 .IX Item "email_in_dn"
494 the same as \fB\-noemailDN\fR. If you want the \s-1EMAIL\s0 field to be removed
495 from the \s-1DN\s0 of the certificate simply set this to 'no'. If not present
496 the default is to allow for the \s-1EMAIL\s0 filed in the certificate's \s-1DN\s0.
497 .IP "\fBmsie_hack\fR" 4
498 .IX Item "msie_hack"
499 the same as \fB\-msie_hack\fR
500 .IP "\fBpolicy\fR" 4
501 .IX Item "policy"
502 the same as \fB\-policy\fR. Mandatory. See the \fB\s-1POLICY\s0 \s-1FORMAT\s0\fR section
503 for more information.
504 .IP "\fBname_opt\fR, \fBcert_opt\fR" 4
505 .IX Item "name_opt, cert_opt"
506 these options allow the format used to display the certificate details
507 when asking the user to confirm signing. All the options supported by
508 the \fBx509\fR utilities \fB\-nameopt\fR and \fB\-certopt\fR switches can be used
509 here, except the \fBno_signame\fR and \fBno_sigdump\fR are permanently set
510 and cannot be disabled (this is because the certificate signature cannot
511 be displayed because the certificate has not been signed at this point).
512 .Sp
513 For convenience the values \fBca_default\fR are accepted by both to produce
514 a reasonable output.
515 .Sp
516 If neither option is present the format used in earlier versions of
517 OpenSSL is used. Use of the old format is \fBstrongly\fR discouraged because
518 it only displays fields mentioned in the \fBpolicy\fR section, mishandles
519 multicharacter string types and does not display extensions.
520 .IP "\fBcopy_extensions\fR" 4
521 .IX Item "copy_extensions"
522 determines how extensions in certificate requests should be handled.
523 If set to \fBnone\fR or this option is not present then extensions are
524 ignored and not copied to the certificate. If set to \fBcopy\fR then any
525 extensions present in the request that are not already present are copied
526 to the certificate. If set to \fBcopyall\fR then all extensions in the
527 request are copied to the certificate: if the extension is already present
528 in the certificate it is deleted first. See the \fB\s-1WARNINGS\s0\fR section before
529 using this option.
530 .Sp
531 The main use of this option is to allow a certificate request to supply
532 values for certain extensions such as subjectAltName.
533 .SH "POLICY FORMAT"
534 .IX Header "POLICY FORMAT"
535 The policy section consists of a set of variables corresponding to
536 certificate \s-1DN\s0 fields. If the value is \*(L"match\*(R" then the field value
537 must match the same field in the \s-1CA\s0 certificate. If the value is
538 \&\*(L"supplied\*(R" then it must be present. If the value is \*(L"optional\*(R" then
539 it may be present. Any fields not mentioned in the policy section
540 are silently deleted, unless the \fB\-preserveDN\fR option is set but
541 this can be regarded more of a quirk than intended behaviour.
542 .SH "SPKAC FORMAT"
543 .IX Header "SPKAC FORMAT"
544 The input to the \fB\-spkac\fR command line option is a Netscape
545 signed public key and challenge. This will usually come from
546 the \fB\s-1KEYGEN\s0\fR tag in an \s-1HTML\s0 form to create a new private key. 
547 It is however possible to create SPKACs using the \fBspkac\fR utility.
548 .PP
549 The file should contain the variable \s-1SPKAC\s0 set to the value of
550 the \s-1SPKAC\s0 and also the required \s-1DN\s0 components as name value pairs.
551 If you need to include the same component twice then it can be
552 preceded by a number and a '.'.
553 .SH "EXAMPLES"
554 .IX Header "EXAMPLES"
555 Note: these examples assume that the \fBca\fR directory structure is
556 already set up and the relevant files already exist. This usually
557 involves creating a \s-1CA\s0 certificate and private key with \fBreq\fR, a
558 serial number file and an empty index file and placing them in
559 the relevant directories.
560 .PP
561 To use the sample configuration file below the directories demoCA,
562 demoCA/private and demoCA/newcerts would be created. The \s-1CA\s0
563 certificate would be copied to demoCA/cacert.pem and its private
564 key to demoCA/private/cakey.pem. A file demoCA/serial would be
565 created containing for example \*(L"01\*(R" and the empty index file
566 demoCA/index.txt.
567 .PP
568 Sign a certificate request:
569 .PP
570 .Vb 1
571 \& openssl ca \-in req.pem \-out newcert.pem
572 .Ve
573 .PP
574 Sign a certificate request, using \s-1CA\s0 extensions:
575 .PP
576 .Vb 1
577 \& openssl ca \-in req.pem \-extensions v3_ca \-out newcert.pem
578 .Ve
579 .PP
580 Generate a \s-1CRL\s0
581 .PP
582 .Vb 1
583 \& openssl ca \-gencrl \-out crl.pem
584 .Ve
585 .PP
586 Sign several requests:
587 .PP
588 .Vb 1
589 \& openssl ca \-infiles req1.pem req2.pem req3.pem
590 .Ve
591 .PP
592 Certify a Netscape \s-1SPKAC:\s0
593 .PP
594 .Vb 1
595 \& openssl ca \-spkac spkac.txt
596 .Ve
597 .PP
598 A sample \s-1SPKAC\s0 file (the \s-1SPKAC\s0 line has been truncated for clarity):
599 .PP
600 .Vb 5
601 \& SPKAC=MIG0MGAwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAn7PDhCeV/xIxUg8V70YRxK2A5
602 \& CN=Steve Test
603 \& emailAddress=steve@openssl.org
604 \& 0.OU=OpenSSL Group
605 \& 1.OU=Another Group
606 .Ve
607 .PP
608 A sample configuration file with the relevant sections for \fBca\fR:
609 .PP
610 .Vb 2
611 \& [ ca ]
612 \& default_ca      = CA_default            # The default ca section
613 \& 
614 \& [ CA_default ]
615 \&
616 \& dir            = ./demoCA              # top dir
617 \& database       = $dir/index.txt        # index file.
618 \& new_certs_dir  = $dir/newcerts         # new certs dir
619 \& 
620 \& certificate    = $dir/cacert.pem       # The CA cert
621 \& serial         = $dir/serial           # serial no file
622 \& private_key    = $dir/private/cakey.pem# CA private key
623 \& RANDFILE       = $dir/private/.rand    # random number file
624 \& 
625 \& default_days   = 365                   # how long to certify for
626 \& default_crl_days= 30                   # how long before next CRL
627 \& default_md     = md5                   # md to use
628 \&
629 \& policy         = policy_any            # default policy
630 \& email_in_dn    = no                    # Don\*(Aqt add the email into cert DN
631 \&
632 \& name_opt       = ca_default            # Subject name display option
633 \& cert_opt       = ca_default            # Certificate display option
634 \& copy_extensions = none                 # Don\*(Aqt copy extensions from request
635 \&
636 \& [ policy_any ]
637 \& countryName            = supplied
638 \& stateOrProvinceName    = optional
639 \& organizationName       = optional
640 \& organizationalUnitName = optional
641 \& commonName             = supplied
642 \& emailAddress           = optional
643 .Ve
644 .SH "FILES"
645 .IX Header "FILES"
646 Note: the location of all files can change either by compile time options,
647 configuration file entries, environment variables or command line options.
648 The values below reflect the default values.
649 .PP
650 .Vb 10
651 \& /usr/local/ssl/lib/openssl.cnf \- master configuration file
652 \& ./demoCA                       \- main CA directory
653 \& ./demoCA/cacert.pem            \- CA certificate
654 \& ./demoCA/private/cakey.pem     \- CA private key
655 \& ./demoCA/serial                \- CA serial number file
656 \& ./demoCA/serial.old            \- CA serial number backup file
657 \& ./demoCA/index.txt             \- CA text database file
658 \& ./demoCA/index.txt.old         \- CA text database backup file
659 \& ./demoCA/certs                 \- certificate output file
660 \& ./demoCA/.rnd                  \- CA random seed information
661 .Ve
662 .SH "ENVIRONMENT VARIABLES"
663 .IX Header "ENVIRONMENT VARIABLES"
664 \&\fB\s-1OPENSSL_CONF\s0\fR reflects the location of master configuration file it can
665 be overridden by the \fB\-config\fR command line option.
666 .SH "RESTRICTIONS"
667 .IX Header "RESTRICTIONS"
668 The text database index file is a critical part of the process and 
669 if corrupted it can be difficult to fix. It is theoretically possible
670 to rebuild the index file from all the issued certificates and a current
671 \&\s-1CRL:\s0 however there is no option to do this.
672 .PP
673 V2 \s-1CRL\s0 features like delta CRLs are not currently supported.
674 .PP
675 Although several requests can be input and handled at once it is only
676 possible to include one \s-1SPKAC\s0 or self signed certificate.
677 .SH "BUGS"
678 .IX Header "BUGS"
679 The use of an in memory text database can cause problems when large
680 numbers of certificates are present because, as the name implies
681 the database has to be kept in memory.
682 .PP
683 The \fBca\fR command really needs rewriting or the required functionality
684 exposed at either a command or interface level so a more friendly utility
685 (perl script or \s-1GUI\s0) can handle things properly. The scripts \fB\s-1CA\s0.sh\fR and
686 \&\fB\s-1CA\s0.pl\fR help a little but not very much.
687 .PP
688 Any fields in a request that are not present in a policy are silently
689 deleted. This does not happen if the \fB\-preserveDN\fR option is used. To
690 enforce the absence of the \s-1EMAIL\s0 field within the \s-1DN\s0, as suggested by
691 RFCs, regardless the contents of the request' subject the \fB\-noemailDN\fR
692 option can be used. The behaviour should be more friendly and
693 configurable.
694 .PP
695 Cancelling some commands by refusing to certify a certificate can
696 create an empty file.
697 .SH "WARNINGS"
698 .IX Header "WARNINGS"
699 The \fBca\fR command is quirky and at times downright unfriendly.
700 .PP
701 The \fBca\fR utility was originally meant as an example of how to do things
702 in a \s-1CA\s0. It was not supposed to be used as a full blown \s-1CA\s0 itself:
703 nevertheless some people are using it for this purpose.
704 .PP
705 The \fBca\fR command is effectively a single user command: no locking is
706 done on the various files and attempts to run more than one \fBca\fR command
707 on the same database can have unpredictable results.
708 .PP
709 The \fBcopy_extensions\fR option should be used with caution. If care is
710 not taken then it can be a security risk. For example if a certificate
711 request contains a basicConstraints extension with \s-1CA:TRUE\s0 and the
712 \&\fBcopy_extensions\fR value is set to \fBcopyall\fR and the user does not spot
713 this when the certificate is displayed then this will hand the requestor
714 a valid \s-1CA\s0 certificate.
715 .PP
716 This situation can be avoided by setting \fBcopy_extensions\fR to \fBcopy\fR
717 and including basicConstraints with \s-1CA:FALSE\s0 in the configuration file.
718 Then if the request contains a basicConstraints extension it will be
719 ignored.
720 .PP
721 It is advisable to also include values for other extensions such
722 as \fBkeyUsage\fR to prevent a request supplying its own values.
723 .PP
724 Additional restrictions can be placed on the \s-1CA\s0 certificate itself.
725 For example if the \s-1CA\s0 certificate has:
726 .PP
727 .Vb 1
728 \& basicConstraints = CA:TRUE, pathlen:0
729 .Ve
730 .PP
731 then even if a certificate is issued with \s-1CA:TRUE\s0 it will not be valid.
732 .SH "SEE ALSO"
733 .IX Header "SEE ALSO"
734 \&\fIreq\fR\|(1), \fIspkac\fR\|(1), \fIx509\fR\|(1), \s-1\fICA\s0.pl\fR\|(1),
735 \&\fIconfig\fR\|(5)