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