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