]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man1/ca.pod
Avoid a self-assignment.
[thirdparty/openssl.git] / doc / man1 / ca.pod
CommitLineData
aba3e65f
DSH
1=pod
2
3=head1 NAME
4
5ca - sample minimal CA application
6
7=head1 SYNOPSIS
8
9B<openssl> B<ca>
169394d4 10[B<-help>]
aba3e65f
DSH
11[B<-verbose>]
12[B<-config filename>]
13[B<-name section>]
14[B<-gencrl>]
15[B<-revoke file>]
b4b42ce6 16[B<-valid file>]
fc1d88f0
RS
17[B<-status serial>]
18[B<-updatedb>]
d618f703
DSH
19[B<-crl_reason reason>]
20[B<-crl_hold instruction>]
21[B<-crl_compromise time>]
22[B<-crl_CA_compromise time>]
aba3e65f
DSH
23[B<-crldays days>]
24[B<-crlhours hours>]
25[B<-crlexts section>]
26[B<-startdate date>]
27[B<-enddate date>]
28[B<-days arg>]
29[B<-md arg>]
30[B<-policy arg>]
31[B<-keyfile arg>]
fc1d88f0 32[B<-keyform PEM|DER>]
aba3e65f 33[B<-key arg>]
bd08a2bd 34[B<-passin arg>]
aba3e65f 35[B<-cert file>]
d6df2b28 36[B<-selfsign>]
aba3e65f
DSH
37[B<-in file>]
38[B<-out file>]
82fc1d9c 39[B<-notext>]
aba3e65f
DSH
40[B<-outdir dir>]
41[B<-infiles>]
42[B<-spkac file>]
43[B<-ss_cert file>]
44[B<-preserveDN>]
89da653f 45[B<-noemailDN>]
aba3e65f
DSH
46[B<-batch>]
47[B<-msie_hack>]
48[B<-extensions section>]
dfebac32 49[B<-extfile section>]
bfa35550 50[B<-engine id>]
57eb1d32
NL
51[B<-subj arg>]
52[B<-utf8>]
6755ff11 53[B<-create_serial>]
57eb1d32 54[B<-multivalue-rdn>]
3ee1eac2
RS
55[B<-rand file...>]
56[B<-writerand file>]
aba3e65f
DSH
57
58=head1 DESCRIPTION
59
60The B<ca> command is a minimal CA application. It can be used
61to sign certificate requests in a variety of forms and generate
62CRLs it also maintains a text database of issued certificates
63and their status.
64
65The options descriptions will be divided into each purpose.
66
3dfda1a6 67=head1 OPTIONS
aba3e65f
DSH
68
69=over 4
70
6755ff11
MR
71=item B<-help>
72
73Print out a usage message.
74
75=item B<-verbose>
76
c4de074e 77This prints extra details about the operations being performed.
6755ff11 78
aba3e65f
DSH
79=item B<-config filename>
80
c4de074e 81Specifies the configuration file to use.
e9681f83
RS
82Optional; for a description of the default value,
83see L<openssl(1)/COMMAND SUMMARY>.
aba3e65f 84
8a0a9392
BM
85=item B<-name section>
86
c4de074e 87Specifies the configuration file section to use (overrides
8a0a9392
BM
88B<default_ca> in the B<ca> section).
89
aba3e65f
DSH
90=item B<-in filename>
91
c4de074e 92An input filename containing a single certificate request to be
aba3e65f
DSH
93signed by the CA.
94
95=item B<-ss_cert filename>
96
c4de074e 97A single self-signed certificate to be signed by the CA.
aba3e65f
DSH
98
99=item B<-spkac filename>
100
c4de074e 101A file containing a single Netscape signed public key and challenge
d618f703 102and additional field values to be signed by the CA. See the B<SPKAC FORMAT>
fc1d88f0 103section for information on the required input and output format.
aba3e65f
DSH
104
105=item B<-infiles>
106
c4de074e 107If present this should be the last option, all subsequent arguments
1bc74519 108are taken as the names of files containing certificate requests.
aba3e65f
DSH
109
110=item B<-out filename>
111
c4de074e 112The output file to output certificates to. The default is standard
aba3e65f 113output. The certificate details will also be printed out to this
fc1d88f0 114file in PEM format (except that B<-spkac> outputs DER format).
aba3e65f
DSH
115
116=item B<-outdir directory>
117
c4de074e 118The directory to output certificates to. The certificate will be
aba3e65f
DSH
119written to a filename consisting of the serial number in hex with
120".pem" appended.
121
122=item B<-cert>
123
c4de074e 124The CA certificate file.
aba3e65f
DSH
125
126=item B<-keyfile filename>
127
c4de074e 128The private key to sign requests with.
aba3e65f 129
fc1d88f0
RS
130=item B<-keyform PEM|DER>
131
c4de074e 132The format of the data in the private key file.
fc1d88f0
RS
133The default is PEM.
134
aba3e65f
DSH
135=item B<-key password>
136
c4de074e 137The password used to encrypt the private key. Since on some
aba3e65f
DSH
138systems the command line arguments are visible (e.g. Unix with
139the 'ps' utility) this option should be used with caution.
140
d6df2b28
RL
141=item B<-selfsign>
142
c4de074e 143Indicates the issued certificates are to be signed with the key
d6df2b28 144the certificate requests were signed with (given with B<-keyfile>).
42b91f28 145Certificate requests signed with a different key are ignored. If
d6df2b28
RL
146B<-spkac>, B<-ss_cert> or B<-gencrl> are given, B<-selfsign> is
147ignored.
148
149A consequence of using B<-selfsign> is that the self-signed
150certificate appears among the entries in the certificate database
151(see the configuration option B<database>), and uses the same
152serial number counter as all other certificates sign with the
153self-signed certificate.
154
bd08a2bd
DSH
155=item B<-passin arg>
156
c4de074e 157The key password source. For more information about the format of B<arg>
9b86974e 158see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
bad40585 159
82fc1d9c
DSH
160=item B<-notext>
161
c4de074e 162Don't output the text form of a certificate to the output file.
82fc1d9c 163
aba3e65f
DSH
164=item B<-startdate date>
165
c4de074e 166This allows the start date to be explicitly set. The format of the
909873bd
PY
167date is YYMMDDHHMMSSZ (the same as an ASN1 UTCTime structure), or
168YYYYMMDDHHMMSSZ (the same as an ASN1 GeneralizedTime structure). In
a970b14f 169both formats, seconds SS and timezone Z must be present.
aba3e65f
DSH
170
171=item B<-enddate date>
172
c4de074e 173This allows the expiry date to be explicitly set. The format of the
909873bd
PY
174date is YYMMDDHHMMSSZ (the same as an ASN1 UTCTime structure), or
175YYYYMMDDHHMMSSZ (the same as an ASN1 GeneralizedTime structure). In
a970b14f 176both formats, seconds SS and timezone Z must be present.
aba3e65f
DSH
177
178=item B<-days arg>
179
c4de074e 180The number of days to certify the certificate for.
aba3e65f
DSH
181
182=item B<-md alg>
183
c4de074e 184The message digest to use.
c03726ca 185Any digest supported by the OpenSSL B<dgst> command can be used.
aba3e65f
DSH
186This option also applies to CRLs.
187
188=item B<-policy arg>
189
c4de074e 190This option defines the CA "policy" to use. This is a section in
aba3e65f
DSH
191the configuration file which decides which fields should be mandatory
192or match the CA certificate. Check out the B<POLICY FORMAT> section
193for more information.
194
195=item B<-msie_hack>
196
a95d7574 197This is a deprecated option to make B<ca> work with very old versions of
aba3e65f
DSH
198the IE certificate enrollment control "certenr3". It used UniversalStrings
199for almost everything. Since the old control has various security bugs
a95d7574 200its use is strongly discouraged.
aba3e65f
DSH
201
202=item B<-preserveDN>
203
53b1899e 204Normally the DN order of a certificate is the same as the order of the
1bc74519 205fields in the relevant policy section. When this option is set the order
19d2bb57 206is the same as the request. This is largely for compatibility with the
53b1899e
DSH
207older IE enrollment control which would only accept certificates if their
208DNs match the order of the request. This is not needed for Xenroll.
aba3e65f 209
89da653f
BM
210=item B<-noemailDN>
211
212The DN of a certificate can contain the EMAIL field if present in the
213request DN, however it is good policy just having the e-mail set into
214the altName extension of the certificate. When this option is set the
215EMAIL field is removed from the certificate' subject and set only in
216the, eventually present, extensions. The B<email_in_dn> keyword can be
217used in the configuration file to enable this behaviour.
218
aba3e65f
DSH
219=item B<-batch>
220
c4de074e 221This sets the batch mode. In this mode no questions will be asked
aba3e65f
DSH
222and all certificates will be certified automatically.
223
224=item B<-extensions section>
225
c4de074e 226The section of the configuration file containing certificate extensions
dfebac32
BM
227to be added when a certificate is issued (defaults to B<x509_extensions>
228unless the B<-extfile> option is used). If no extension section is
229present then, a V1 certificate is created. If the extension section
137de5b1 230is present (even if it is empty), then a V3 certificate is created. See the:w
9b86974e 231L<x509v3_config(5)> manual page for details of the
137de5b1 232extension section format.
dfebac32
BM
233
234=item B<-extfile file>
235
c4de074e 236An additional configuration file to read certificate extensions from
dfebac32
BM
237(using the default section unless the B<-extensions> option is also
238used).
aba3e65f 239
bfa35550
RL
240=item B<-engine id>
241
c4de074e 242Specifying an engine (by its unique B<id> string) will cause B<ca>
bfa35550
RL
243to attempt to obtain a functional reference to the specified engine,
244thus initialising it if needed. The engine will then be set as the default
245for all available algorithms.
246
57eb1d32
NL
247=item B<-subj arg>
248
c4de074e 249Supersedes subject name given in the request.
57eb1d32
NL
250The arg must be formatted as I</type0=value0/type1=value1/type2=...>,
251characters may be escaped by \ (backslash), no spaces are skipped.
252
253=item B<-utf8>
254
c4de074e 255This option causes field values to be interpreted as UTF8 strings, by
57eb1d32
NL
256default they are interpreted as ASCII. This means that the field
257values, whether prompted from a terminal or obtained from a
258configuration file, must be valid UTF8 strings.
259
6755ff11
MR
260=item B<-create_serial>
261
c4de074e 262If reading serial from the text file as specified in the configuration
6755ff11
MR
263fails, specifying this option creates a new random serial to be used as next
264serial number.
265
57eb1d32
NL
266=item B<-multivalue-rdn>
267
4c583c36 268This option causes the -subj argument to be interpreted with full
57eb1d32
NL
269support for multivalued RDNs. Example:
270
271I</DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe>
272
273If -multi-rdn is not used then the UID value is I<123456+CN=John Doe>.
274
3ee1eac2
RS
275=item B<-rand file...>
276
277A file or files containing random data used to seed the random number
278generator.
279Multiple files can be specified separated by an OS-dependent character.
280The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
281all others.
282
283=item [B<-writerand file>]
284
285Writes random data to the specified I<file> upon exit.
286This can be used with a subsequent B<-rand> flag.
287
aba3e65f
DSH
288=back
289
290=head1 CRL OPTIONS
291
292=over 4
293
294=item B<-gencrl>
295
c4de074e 296This option generates a CRL based on information in the index file.
aba3e65f
DSH
297
298=item B<-crldays num>
299
c4de074e 300The number of days before the next CRL is due. That is the days from
aba3e65f
DSH
301now to place in the CRL nextUpdate field.
302
303=item B<-crlhours num>
304
c4de074e 305The number of hours before the next CRL is due.
aba3e65f
DSH
306
307=item B<-revoke filename>
308
c4de074e 309A filename containing a certificate to revoke.
aba3e65f 310
b4b42ce6
F
311=item B<-valid filename>
312
c4de074e 313A filename containing a certificate to add a Valid certificate entry.
b4b42ce6 314
fc1d88f0
RS
315=item B<-status serial>
316
c4de074e 317Displays the revocation status of the certificate with the specified
fc1d88f0
RS
318serial number and exits.
319
320=item B<-updatedb>
321
322Updates the database index to purge expired certificates.
323
d618f703
DSH
324=item B<-crl_reason reason>
325
c4de074e 326Revocation reason, where B<reason> is one of: B<unspecified>, B<keyCompromise>,
d618f703
DSH
327B<CACompromise>, B<affiliationChanged>, B<superseded>, B<cessationOfOperation>,
328B<certificateHold> or B<removeFromCRL>. The matching of B<reason> is case
329insensitive. Setting any revocation reason will make the CRL v2.
330
42b91f28 331In practice B<removeFromCRL> is not particularly useful because it is only used
d618f703
DSH
332in delta CRLs which are not currently implemented.
333
334=item B<-crl_hold instruction>
335
336This sets the CRL revocation reason code to B<certificateHold> and the hold
337instruction to B<instruction> which must be an OID. Although any OID can be
338used only B<holdInstructionNone> (the use of which is discouraged by RFC2459)
339B<holdInstructionCallIssuer> or B<holdInstructionReject> will normally be used.
340
341=item B<-crl_compromise time>
342
343This sets the revocation reason to B<keyCompromise> and the compromise time to
344B<time>. B<time> should be in GeneralizedTime format that is B<YYYYMMDDHHMMSSZ>.
345
346=item B<-crl_CA_compromise time>
347
348This is the same as B<crl_compromise> except the revocation reason is set to
349B<CACompromise>.
350
aba3e65f
DSH
351=item B<-crlexts section>
352
c4de074e 353The section of the configuration file containing CRL extensions to
aba3e65f
DSH
354include. If no CRL extension section is present then a V1 CRL is
355created, if the CRL extension section is present (even if it is
356empty) then a V2 CRL is created. The CRL extensions specified are
357CRL extensions and B<not> CRL entry extensions. It should be noted
137de5b1 358that some software (for example Netscape) can't handle V2 CRLs. See
9b86974e 359L<x509v3_config(5)> manual page for details of the
137de5b1 360extension section format.
aba3e65f
DSH
361
362=back
363
364=head1 CONFIGURATION FILE OPTIONS
365
8a0a9392
BM
366The section of the configuration file containing options for B<ca>
367is found as follows: If the B<-name> command line option is used,
368then it names the section to be used. Otherwise the section to
369be used must be named in the B<default_ca> option of the B<ca> section
370of the configuration file (or in the default section of the
371configuration file). Besides B<default_ca>, the following options are
372read directly from the B<ca> section:
373 RANDFILE
374 preserve
375 msie_hack
376With the exception of B<RANDFILE>, this is probably a bug and may
377change in future releases.
378
379Many of the configuration file options are identical to command line
aba3e65f
DSH
380options. Where the option is present in the configuration file
381and the command line the command line value is used. Where an
382option is described as mandatory then it must be present in
383the configuration file or the command line equivalent (if
384any) used.
385
386=over 4
387
5e76807b
DSH
388=item B<oid_file>
389
390This specifies a file containing additional B<OBJECT IDENTIFIERS>.
391Each line of the file should consist of the numerical form of the
392object identifier followed by white space then the short name followed
1bc74519 393by white space and finally the long name.
5e76807b
DSH
394
395=item B<oid_section>
396
397This specifies a section in the configuration file containing extra
398object identifiers. Each line should consist of the short name of the
399object identifier followed by B<=> and the numerical form. The short
400and long names are the same when this option is used.
401
aba3e65f
DSH
402=item B<new_certs_dir>
403
c4de074e 404The same as the B<-outdir> command line option. It specifies
aba3e65f
DSH
405the directory where new certificates will be placed. Mandatory.
406
407=item B<certificate>
408
c4de074e 409The same as B<-cert>. It gives the file containing the CA
aba3e65f
DSH
410certificate. Mandatory.
411
412=item B<private_key>
413
c4de074e 414Same as the B<-keyfile> option. The file containing the
aba3e65f
DSH
415CA private key. Mandatory.
416
417=item B<RANDFILE>
418
3ee1eac2
RS
419At startup the specified file is loaded into the random number generator,
420and at exit 256 bytes will be written to it.
aba3e65f
DSH
421
422=item B<default_days>
423
c4de074e 424The same as the B<-days> option. The number of days to certify
1bc74519 425a certificate for.
aba3e65f
DSH
426
427=item B<default_startdate>
428
c4de074e 429The same as the B<-startdate> option. The start date to certify
aba3e65f
DSH
430a certificate for. If not set the current time is used.
431
432=item B<default_enddate>
433
c4de074e 434The same as the B<-enddate> option. Either this option or
aba3e65f
DSH
435B<default_days> (or the command line equivalents) must be
436present.
437
438=item B<default_crl_hours default_crl_days>
439
c4de074e 440The same as the B<-crlhours> and the B<-crldays> options. These
aba3e65f
DSH
441will only be used if neither command line option is present. At
442least one of these must be present to generate a CRL.
443
444=item B<default_md>
445
c4de074e 446The same as the B<-md> option. Mandatory.
aba3e65f
DSH
447
448=item B<database>
449
c4de074e 450The text database file to use. Mandatory. This file must be present
aba3e65f
DSH
451though initially it will be empty.
452
d6df2b28
RL
453=item B<unique_subject>
454
c4de074e 455If the value B<yes> is given, the valid certificate entries in the
d6df2b28
RL
456database must have unique subjects. if the value B<no> is given,
457several valid certificate entries may have the exact same subject.
458The default value is B<yes>, to be compatible with older (pre 0.9.8)
459versions of OpenSSL. However, to make CA certificate roll-over easier,
460it's recommended to use the value B<no>, especially if combined with
461the B<-selfsign> command line option.
462
c5aba56c 463=item B<serial>
aba3e65f 464
c4de074e 465A text file containing the next serial number to use in hex. Mandatory.
aba3e65f
DSH
466This file must be present and contain a valid serial number.
467
8fbb2af3
RL
468=item B<crlnumber>
469
c4de074e 470A text file containing the next CRL number to use in hex. The crl number
8fbb2af3
RL
471will be inserted in the CRLs only if this file exists. If this file is
472present, it must contain a valid CRL number.
473
aba3e65f
DSH
474=item B<x509_extensions>
475
c4de074e 476The same as B<-extensions>.
aba3e65f
DSH
477
478=item B<crl_extensions>
479
c4de074e 480The same as B<-crlexts>.
aba3e65f
DSH
481
482=item B<preserve>
483
c4de074e 484The same as B<-preserveDN>
aba3e65f 485
89da653f
BM
486=item B<email_in_dn>
487
c4de074e 488The same as B<-noemailDN>. If you want the EMAIL field to be removed
89da653f
BM
489from the DN of the certificate simply set this to 'no'. If not present
490the default is to allow for the EMAIL filed in the certificate's DN.
491
aba3e65f
DSH
492=item B<msie_hack>
493
c4de074e 494The same as B<-msie_hack>
aba3e65f
DSH
495
496=item B<policy>
497
c4de074e 498The same as B<-policy>. Mandatory. See the B<POLICY FORMAT> section
aba3e65f
DSH
499for more information.
500
b325518f 501=item B<name_opt>, B<cert_opt>
e890dcdb 502
c4de074e 503These options allow the format used to display the certificate details
e890dcdb
DSH
504when asking the user to confirm signing. All the options supported by
505the B<x509> utilities B<-nameopt> and B<-certopt> switches can be used
506here, except the B<no_signame> and B<no_sigdump> are permanently set
507and cannot be disabled (this is because the certificate signature cannot
508be displayed because the certificate has not been signed at this point).
509
6f2f534b 510For convenience the values B<ca_default> are accepted by both to produce
e890dcdb
DSH
511a reasonable output.
512
513If neither option is present the format used in earlier versions of
514OpenSSL is used. Use of the old format is B<strongly> discouraged because
515it only displays fields mentioned in the B<policy> section, mishandles
516multicharacter string types and does not display extensions.
517
791bd0cd
DSH
518=item B<copy_extensions>
519
c4de074e 520Determines how extensions in certificate requests should be handled.
791bd0cd
DSH
521If set to B<none> or this option is not present then extensions are
522ignored and not copied to the certificate. If set to B<copy> then any
523extensions present in the request that are not already present are copied
524to the certificate. If set to B<copyall> then all extensions in the
525request are copied to the certificate: if the extension is already present
526in the certificate it is deleted first. See the B<WARNINGS> section before
527using this option.
528
529The main use of this option is to allow a certificate request to supply
530values for certain extensions such as subjectAltName.
531
aba3e65f
DSH
532=back
533
534=head1 POLICY FORMAT
535
536The policy section consists of a set of variables corresponding to
537certificate DN fields. If the value is "match" then the field value
538must match the same field in the CA certificate. If the value is
539"supplied" then it must be present. If the value is "optional" then
540it may be present. Any fields not mentioned in the policy section
541are silently deleted, unless the B<-preserveDN> option is set but
542this can be regarded more of a quirk than intended behaviour.
543
544=head1 SPKAC FORMAT
545
546The input to the B<-spkac> command line option is a Netscape
547signed public key and challenge. This will usually come from
1bc74519 548the B<KEYGEN> tag in an HTML form to create a new private key.
aba3e65f
DSH
549It is however possible to create SPKACs using the B<spkac> utility.
550
551The file should contain the variable SPKAC set to the value of
552the SPKAC and also the required DN components as name value pairs.
553If you need to include the same component twice then it can be
554preceded by a number and a '.'.
555
fc1d88f0
RS
556When processing SPKAC format, the output is DER if the B<-out>
557flag is used, but PEM format if sending to stdout or the B<-outdir>
558flag is used.
559
aba3e65f
DSH
560=head1 EXAMPLES
561
562Note: these examples assume that the B<ca> directory structure is
563already set up and the relevant files already exist. This usually
564involves creating a CA certificate and private key with B<req>, a
565serial number file and an empty index file and placing them in
566the relevant directories.
567
568To use the sample configuration file below the directories demoCA,
569demoCA/private and demoCA/newcerts would be created. The CA
570certificate would be copied to demoCA/cacert.pem and its private
571key to demoCA/private/cakey.pem. A file demoCA/serial would be
572created containing for example "01" and the empty index file
573demoCA/index.txt.
574
575
576Sign a certificate request:
577
1675f6eb 578 openssl ca -in req.pem -out newcert.pem
aba3e65f 579
d428bf8c
DSH
580Sign a certificate request, using CA extensions:
581
582 openssl ca -in req.pem -extensions v3_ca -out newcert.pem
583
aba3e65f
DSH
584Generate a CRL
585
1675f6eb 586 openssl ca -gencrl -out crl.pem
aba3e65f
DSH
587
588Sign several requests:
589
1675f6eb 590 openssl ca -infiles req1.pem req2.pem req3.pem
aba3e65f
DSH
591
592Certify a Netscape SPKAC:
593
1675f6eb 594 openssl ca -spkac spkac.txt
aba3e65f
DSH
595
596A sample SPKAC file (the SPKAC line has been truncated for clarity):
597
598 SPKAC=MIG0MGAwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAn7PDhCeV/xIxUg8V70YRxK2A5
599 CN=Steve Test
600 emailAddress=steve@openssl.org
601 0.OU=OpenSSL Group
602 1.OU=Another Group
603
604A sample configuration file with the relevant sections for B<ca>:
605
606 [ ca ]
607 default_ca = CA_default # The default ca section
1bc74519 608
aba3e65f
DSH
609 [ CA_default ]
610
611 dir = ./demoCA # top dir
612 database = $dir/index.txt # index file.
1bc74519
RS
613 new_certs_dir = $dir/newcerts # new certs dir
614
aba3e65f
DSH
615 certificate = $dir/cacert.pem # The CA cert
616 serial = $dir/serial # serial no file
617 private_key = $dir/private/cakey.pem# CA private key
618 RANDFILE = $dir/private/.rand # random number file
1bc74519 619
aba3e65f
DSH
620 default_days = 365 # how long to certify for
621 default_crl_days= 30 # how long before next CRL
622 default_md = md5 # md to use
623
624 policy = policy_any # default policy
89da653f 625 email_in_dn = no # Don't add the email into cert DN
aba3e65f 626
1bc74519
RS
627 name_opt = ca_default # Subject name display option
628 cert_opt = ca_default # Certificate display option
629 copy_extensions = none # Don't copy extensions from request
e890dcdb 630
aba3e65f
DSH
631 [ policy_any ]
632 countryName = supplied
633 stateOrProvinceName = optional
634 organizationName = optional
635 organizationalUnitName = optional
636 commonName = supplied
637 emailAddress = optional
638
aba3e65f
DSH
639=head1 FILES
640
641Note: the location of all files can change either by compile time options,
19d2bb57 642configuration file entries, environment variables or command line options.
aba3e65f
DSH
643The values below reflect the default values.
644
645 /usr/local/ssl/lib/openssl.cnf - master configuration file
646 ./demoCA - main CA directory
647 ./demoCA/cacert.pem - CA certificate
648 ./demoCA/private/cakey.pem - CA private key
649 ./demoCA/serial - CA serial number file
650 ./demoCA/serial.old - CA serial number backup file
651 ./demoCA/index.txt - CA text database file
652 ./demoCA/index.txt.old - CA text database backup file
653 ./demoCA/certs - certificate output file
654 ./demoCA/.rnd - CA random seed information
655
aba3e65f
DSH
656=head1 RESTRICTIONS
657
1bc74519 658The text database index file is a critical part of the process and
aba3e65f
DSH
659if corrupted it can be difficult to fix. It is theoretically possible
660to rebuild the index file from all the issued certificates and a current
661CRL: however there is no option to do this.
662
cb26a20c 663V2 CRL features like delta CRLs are not currently supported.
aba3e65f
DSH
664
665Although several requests can be input and handled at once it is only
77a795e4 666possible to include one SPKAC or self-signed certificate.
aba3e65f
DSH
667
668=head1 BUGS
669
77a795e4 670The use of an in-memory text database can cause problems when large
aba3e65f
DSH
671numbers of certificates are present because, as the name implies
672the database has to be kept in memory.
673
aba3e65f
DSH
674The B<ca> command really needs rewriting or the required functionality
675exposed at either a command or interface level so a more friendly utility
be739b0c
RS
676(perl script or GUI) can handle things properly. The script
677B<CA.pl> helps a little but not very much.
aba3e65f
DSH
678
679Any fields in a request that are not present in a policy are silently
89da653f
BM
680deleted. This does not happen if the B<-preserveDN> option is used. To
681enforce the absence of the EMAIL field within the DN, as suggested by
682RFCs, regardless the contents of the request' subject the B<-noemailDN>
683option can be used. The behaviour should be more friendly and
684configurable.
aba3e65f 685
42b91f28 686Canceling some commands by refusing to certify a certificate can
aba3e65f
DSH
687create an empty file.
688
791bd0cd
DSH
689=head1 WARNINGS
690
1f309464
LJ
691The B<ca> command is quirky and at times downright unfriendly.
692
693The B<ca> utility was originally meant as an example of how to do things
694in a CA. It was not supposed to be used as a full blown CA itself:
695nevertheless some people are using it for this purpose.
696
697The B<ca> command is effectively a single user command: no locking is
698done on the various files and attempts to run more than one B<ca> command
699on the same database can have unpredictable results.
700
791bd0cd
DSH
701The B<copy_extensions> option should be used with caution. If care is
702not taken then it can be a security risk. For example if a certificate
703request contains a basicConstraints extension with CA:TRUE and the
704B<copy_extensions> value is set to B<copyall> and the user does not spot
42b91f28 705this when the certificate is displayed then this will hand the requester
791bd0cd
DSH
706a valid CA certificate.
707
708This situation can be avoided by setting B<copy_extensions> to B<copy>
709and including basicConstraints with CA:FALSE in the configuration file.
710Then if the request contains a basicConstraints extension it will be
711ignored.
712
713It is advisable to also include values for other extensions such
714as B<keyUsage> to prevent a request supplying its own values.
715
716Additional restrictions can be placed on the CA certificate itself.
717For example if the CA certificate has:
718
719 basicConstraints = CA:TRUE, pathlen:0
720
721then even if a certificate is issued with CA:TRUE it will not be valid.
722
909873bd
PY
723=head1 HISTORY
724
725Since OpenSSL 1.1.1, the program follows RFC5280. Specifically,
726certificate validity period (specified by any of B<-startdate>,
727B<-enddate> and B<-days>) will be encoded as UTCTime if the dates are
728earlier than year 2049 (included), and as GeneralizedTime if the dates
729are in year 2050 or later.
730
aba3e65f
DSH
731=head1 SEE ALSO
732
9b86974e 733L<req(1)>, L<spkac(1)>, L<x509(1)>, L<CA.pl(1)>,
1bc74519 734L<config(5)>, L<x509v3_config(5)>
aba3e65f 735
e2f92610
RS
736=head1 COPYRIGHT
737
c4de074e 738Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
e2f92610
RS
739
740Licensed under the OpenSSL license (the "License"). You may not use
741this file except in compliance with the License. You can obtain a copy
742in the file LICENSE in the source distribution or at
743L<https://www.openssl.org/source/license.html>.
744
745=cut