]> git.ipfire.org Git - thirdparty/openssl.git/blob - doc/man1/openssl-x509.pod.in
apps/x509.c: Take the -signkey arg as default pubkey with -new
[thirdparty/openssl.git] / doc / man1 / openssl-x509.pod.in
1 =pod
2 {- OpenSSL::safe::output_do_not_edit_headers(); -}
3
4 =head1 NAME
5
6 openssl-x509 - Certificate display and signing command
7
8 =head1 SYNOPSIS
9
10 B<openssl> B<x509>
11 [B<-help>]
12 [B<-inform> B<DER>|B<PEM>]
13 [B<-outform> B<DER>|B<PEM>]
14 [B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>]
15 [B<-CAform> B<DER>|B<PEM>|B<P12>]
16 [B<-CAkeyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>]
17 [B<-in> I<filename>]
18 [B<-out> I<filename>]
19 [B<-serial>]
20 [B<-hash>]
21 [B<-subject_hash>]
22 [B<-subject_hash_old>]
23 [B<-issuer_hash>]
24 [B<-issuer_hash_old>]
25 [B<-ocspid>]
26 [B<-subject>]
27 [B<-issuer>]
28 [B<-email>]
29 [B<-ocsp_uri>]
30 [B<-startdate>]
31 [B<-enddate>]
32 [B<-purpose>]
33 [B<-dates>]
34 [B<-checkend> I<num>]
35 [B<-modulus>]
36 [B<-pubkey>]
37 [B<-fingerprint>]
38 [B<-alias>]
39 [B<-noout>]
40 [B<-trustout>]
41 [B<-clrtrust>]
42 [B<-clrreject>]
43 [B<-addtrust> I<arg>]
44 [B<-addreject> I<arg>]
45 [B<-setalias> I<arg>]
46 [B<-days> I<arg>]
47 [B<-set_serial> I<n>]
48 [B<-signkey> I<filename>|I<uri>]
49 [B<-badsig>]
50 [B<-passin> I<arg>]
51 [B<-x509toreq>]
52 [B<-req>]
53 [B<-CA> I<filename>]
54 [B<-CAkey> I<filename>|I<uri>]
55 [B<-CAcreateserial>]
56 [B<-CAserial> I<filename>]
57 [B<-new>]
58 [B<-next_serial>]
59 [B<-nocert>]
60 [B<-force_pubkey> I<filename>]
61 [B<-subj> I<arg>]
62 [B<-text>]
63 [B<-ext> I<extensions>]
64 [B<-certopt> I<option>]
65 [B<-checkhost> I<host>]
66 [B<-checkemail> I<host>]
67 [B<-checkip> I<ipaddr>]
68 [B<-I<digest>>]
69 [B<-clrext>]
70 [B<-extfile> I<filename>]
71 [B<-extensions> I<section>]
72 [B<-sigopt> I<nm>:I<v>]
73 [B<-vfyopt> I<nm>:I<v>]
74 [B<-preserve_dates>]
75 {- $OpenSSL::safe::opt_name_synopsis -}
76 {- $OpenSSL::safe::opt_r_synopsis -}
77 {- $OpenSSL::safe::opt_engine_synopsis -}{- $OpenSSL::safe::opt_provider_synopsis -}
78
79 =for openssl ifdef engine subject_hash_old issuer_hash_old
80
81 =head1 DESCRIPTION
82
83 This command is a multi-purposes certificate command. It can
84 be used to display certificate information, convert certificates to
85 various forms, sign certificate requests like a "mini CA" or edit
86 certificate trust settings.
87
88 Since there are a large number of options they will split up into
89 various sections.
90
91 =head1 OPTIONS
92
93 =head2 Input, Output, and General Purpose Options
94
95 =over 4
96
97 =item B<-help>
98
99 Print out a usage message.
100
101 =item B<-inform> B<DER>|B<PEM>
102
103 The CSR input format; the default is B<PEM>.
104 See L<openssl-format-options(1)> for details.
105
106 The input is normally an X.509 certificate file of any format,
107 but this can change if other options such as B<-req> are used.
108
109 B<-outform> B<DER>|B<PEM>
110
111 The output format; the default is B<PEM>.
112 See L<openssl-format-options(1)> for details.
113
114 =item B<-in> I<filename>
115
116 This specifies the input filename to read a certificate from or standard input
117 if this option is not specified.
118
119 =item B<-out> I<filename>
120
121 This specifies the output filename to write to or standard output by
122 default.
123
124 =item B<-I<digest>>
125
126 The digest to use.
127 This affects any signing or display option that uses a message
128 digest, such as the B<-fingerprint>, B<-signkey> and B<-CA> options.
129 Any digest supported by the L<openssl-dgst(1)> command can be used.
130 If not specified then SHA1 is used with B<-fingerprint> or
131 the default digest for the signing algorithm is used, typically SHA256.
132
133 =item B<-preserve_dates>
134
135 When signing a certificate, preserve the "notBefore" and "notAfter" dates
136 instead of adjusting them to current time and duration.
137 Cannot be used with the B<-days> option.
138
139 {- $OpenSSL::safe::opt_r_synopsis -}
140
141 {- $OpenSSL::safe::opt_engine_item -}
142
143 {- $OpenSSL::safe::opt_provider_item -}
144
145 =back
146
147 =head2 Display Options
148
149 Note: the B<-alias> and B<-purpose> options are also display options
150 but are described in the L</Trust Settings> section.
151
152 =over 4
153
154 =item B<-text>
155
156 Prints out the certificate in text form. Full details are output including the
157 public key, signature algorithms, issuer and subject names, serial number
158 any extensions present and any trust settings.
159
160 =item B<-ext> I<extensions>
161
162 Prints out the certificate extensions in text form. Extensions are specified
163 with a comma separated string, e.g., "subjectAltName,subjectKeyIdentifier".
164 See the L<x509v3_config(5)> manual page for the extension names.
165
166 =item B<-certopt> I<option>
167
168 Customise the output format used with B<-text>. The I<option> argument
169 can be a single option or multiple options separated by commas. The
170 B<-certopt> switch may be also be used more than once to set multiple
171 options. See the L</Text Options> section for more information.
172
173 =item B<-checkhost> I<host>
174
175 Check that the certificate matches the specified host.
176
177 =item B<-checkemail> I<email>
178
179 Check that the certificate matches the specified email address.
180
181 =item B<-checkip> I<ipaddr>
182
183 Check that the certificate matches the specified IP address.
184
185 =item B<-noout>
186
187 This option prevents output of the encoded version of the certificate.
188
189 =item B<-pubkey>
190
191 Outputs the certificate's SubjectPublicKeyInfo block in PEM format.
192
193 =item B<-modulus>
194
195 This option prints out the value of the modulus of the public key
196 contained in the certificate.
197
198 =item B<-serial>
199
200 Outputs the certificate serial number.
201
202 =item B<-subject_hash>
203
204 Outputs the "hash" of the certificate subject name. This is used in OpenSSL to
205 form an index to allow certificates in a directory to be looked up by subject
206 name.
207
208 =item B<-issuer_hash>
209
210 Outputs the "hash" of the certificate issuer name.
211
212 =item B<-ocspid>
213
214 Outputs the OCSP hash values for the subject name and public key.
215
216 =item B<-hash>
217
218 Synonym for "-subject_hash" for backward compatibility reasons.
219
220 =item B<-subject_hash_old>
221
222 Outputs the "hash" of the certificate subject name using the older algorithm
223 as used by OpenSSL before version 1.0.0.
224
225 =item B<-issuer_hash_old>
226
227 Outputs the "hash" of the certificate issuer name using the older algorithm
228 as used by OpenSSL before version 1.0.0.
229
230 =item B<-subject>
231
232 Outputs the subject name.
233
234 =item B<-issuer>
235
236 Outputs the issuer name.
237
238 {- $OpenSSL::safe::opt_name_item -}
239
240 =item B<-email>
241
242 Outputs the email address(es) if any.
243
244 =item B<-ocsp_uri>
245
246 Outputs the OCSP responder address(es) if any.
247
248 =item B<-startdate>
249
250 Prints out the start date of the certificate, that is the notBefore date.
251
252 =item B<-enddate>
253
254 Prints out the expiry date of the certificate, that is the notAfter date.
255
256 =item B<-dates>
257
258 Prints out the start and expiry dates of a certificate.
259
260 =item B<-checkend> I<arg>
261
262 Checks if the certificate expires within the next I<arg> seconds and exits
263 nonzero if yes it will expire or zero if not.
264
265 =item B<-fingerprint>
266
267 Calculates and outputs the digest of the DER encoded version of the entire
268 certificate (see digest options).
269 This is commonly called a "fingerprint". Because of the nature of message
270 digests, the fingerprint of a certificate is unique to that certificate and
271 two certificates with the same fingerprint can be considered to be the same.
272
273 =back
274
275 =head2 Trust Settings
276
277 A B<trusted certificate> is an ordinary certificate which has several
278 additional pieces of information attached to it such as the permitted
279 and prohibited uses of the certificate and an "alias".
280
281 Normally when a certificate is being verified at least one certificate
282 must be "trusted". By default a trusted certificate must be stored
283 locally and must be a root CA: any certificate chain ending in this CA
284 is then usable for any purpose.
285
286 Trust settings currently are only used with a root CA. They allow a finer
287 control over the purposes the root CA can be used for. For example a CA
288 may be trusted for SSL client but not SSL server use.
289
290 See the description in L<openssl-verify(1)> for more information
291 on the meaning of trust settings.
292
293 Future versions of OpenSSL will recognize trust settings on any
294 certificate: not just root CAs.
295
296
297 =over 4
298
299 =item B<-trustout>
300
301 Output a B<trusted> certificate rather than an ordinary. An ordinary
302 or trusted certificate can be input but by default an ordinary
303 certificate is output and any trust settings are discarded. With the
304 B<-trustout> option a trusted certificate is output. A trusted
305 certificate is automatically output if any trust settings are modified.
306
307 =item B<-setalias> I<arg>
308
309 Sets the alias of the certificate. This will allow the certificate
310 to be referred to using a nickname for example "Steve's Certificate".
311
312 =item B<-alias>
313
314 Outputs the certificate alias, if any.
315
316 =item B<-clrtrust>
317
318 Clears all the permitted or trusted uses of the certificate.
319
320 =item B<-clrreject>
321
322 Clears all the prohibited or rejected uses of the certificate.
323
324 =item B<-addtrust> I<arg>
325
326 Adds a trusted certificate use.
327 Any object name can be used here but currently only B<clientAuth> (SSL client
328 use), B<serverAuth> (SSL server use), B<emailProtection> (S/MIME email) and
329 B<anyExtendedKeyUsage> are used.
330 As of OpenSSL 1.1.0, the last of these blocks all purposes when rejected or
331 enables all purposes when trusted.
332 Other OpenSSL applications may define additional uses.
333
334 =item B<-addreject> I<arg>
335
336 Adds a prohibited use. It accepts the same values as the B<-addtrust>
337 option.
338
339 =item B<-purpose>
340
341 This option performs tests on the certificate extensions and outputs
342 the results. For a more complete description see the
343 L</CERTIFICATE EXTENSIONS> section.
344
345 =back
346
347 =head2 Signing Options
348
349 This command can be used to sign certificates and requests: it
350 can thus behave like a "mini CA".
351
352 =over 4
353
354 =item B<-signkey> I<filename>|I<uri>
355
356 This option causes the input file to be self signed using the supplied
357 private key.
358
359 It sets the issuer name to the subject name (i.e., makes it self-issued)
360 and changes the public key to the supplied value (unless overridden by
361 B<-force_pubkey>). It sets the validity start date to the current time
362 and the end date to a value determined by the B<-days> option.
363 It retains any certificate extensions unless the B<-clrext> option is supplied;
364 this includes, for example, any existing key identifier extensions.
365
366 =item B<-badsig>
367
368 Corrupt the signature before writing it; this can be useful
369 for testing.
370
371 =item B<-sigopt> I<nm>:I<v>
372
373 Pass options to the signature algorithm during sign operations.
374 Names and values of these options are algorithm-specific.
375
376 =item B<-vfyopt> I<nm>:I<v>
377
378 Pass options to the signature algorithm during verify operations.
379 Names and values of these options are algorithm-specific.
380
381 =item B<-passin> I<arg>
382
383 The key and certificate file password source.
384 For more information about the format of I<arg>
385 see L<openssl-passphrase-options(1)>.
386
387 =item B<-clrext>
388
389 Delete any extensions from a certificate. This option is used when a
390 certificate is being created from another certificate (for example with
391 the B<-signkey> or the B<-CA> options). Normally all extensions are
392 retained.
393
394 =item B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>
395
396 The key format; the default is B<PEM>.
397 The only value with effect is B<ENGINE>; all others have become obsolete.
398 See L<openssl-format-options(1)> for details.
399
400 =item B<-CAform> B<DER>|B<PEM>|B<P12>,
401
402 The format for the CA certificate.
403 This option has no effect and is retained for backward compatibility.
404
405 =item B<-CAkeyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>
406
407 The format for the CA key; the default is B<PEM>.
408 The only value with effect is B<ENGINE>; all others have become obsolete.
409 See L<openssl-format-options(1)> for details.
410
411 =item B<-days> I<arg>
412
413 Specifies the number of days to make a certificate valid for. The default
414 is 30 days. Cannot be used with the B<-preserve_dates> option.
415
416 =item B<-x509toreq>
417
418 Converts a certificate into a certificate request. The B<-signkey> option
419 is used to pass the required private key.
420
421 =item B<-req>
422
423 By default a certificate is expected on input. With this option a
424 certificate request is expected instead.
425
426 =item B<-set_serial> I<n>
427
428 Specifies the serial number to use. This option can be used with either
429 the B<-signkey> or B<-CA> options. If used in conjunction with the B<-CA>
430 option the serial number file (as specified by the B<-CAserial> or
431 B<-CAcreateserial> options) is not used.
432
433 The serial number can be decimal or hex (if preceded by C<0x>).
434
435 =item B<-CA> I<filename>
436
437 Specifies the CA certificate to be used for signing. When this option is
438 present, this command behaves like a "mini CA". The input file is signed by
439 this CA using this option: that is its issuer name is set to the subject name
440 of the CA and it is digitally signed using the CAs private key.
441
442 This option is normally combined with the B<-req> option. Without the
443 B<-req> option the input is a certificate which must be self signed.
444
445 =item B<-CAkey> I<filename>|I<uri>
446
447 Sets the CA private key to sign a certificate with. If this option is
448 not specified then it is assumed that the CA private key is present in
449 the CA certificate file.
450
451 =item B<-CAserial> I<filename>
452
453 Sets the CA serial number file to use.
454
455 When the B<-CA> option is used to sign a certificate it uses a serial
456 number specified in a file. This file consists of one line containing
457 an even number of hex digits with the serial number to use. After each
458 use the serial number is incremented and written out to the file again.
459
460 The default filename consists of the CA certificate file base name with
461 F<.srl> appended. For example if the CA certificate file is called
462 F<mycacert.pem> it expects to find a serial number file called
463 F<mycacert.srl>.
464
465 =item B<-CAcreateserial>
466
467 With this option the CA serial number file is created if it does not exist:
468 it will contain the serial number "02" and the certificate being signed will
469 have the 1 as its serial number. If the B<-CA> option is specified
470 and the serial number file does not exist a random number is generated;
471 this is the recommended practice.
472
473 =item B<-extfile> I<filename>
474
475 File containing certificate extensions to use. If not specified then
476 no extensions are added to the certificate.
477
478 =item B<-extensions> I<section>
479
480 The section to add certificate extensions from. If this option is not
481 specified then the extensions should either be contained in the unnamed
482 (default) section or the default section should contain a variable called
483 "extensions" which contains the section to use. See the
484 L<x509v3_config(5)> manual page for details of the
485 extension section format.
486
487 =item B<-new>
488
489 Generate a certificate from scratch, not using an input certificate
490 or certificate request. So the B<-in> option must not be used in this case.
491 Instead, the B<-subj> option needs to be given.
492 The public key to include defaults to the key given with the B<-signkey> option,
493 which implies self-signature.
494 It may also be given explicity using the B<-force_pubkey> option.
495
496 =item B<-next_serial>
497
498 Set the serial to be one more than the number in the certificate.
499
500 =item B<-nocert>
501
502 Do not generate or output a certificate.
503
504 =item B<-force_pubkey> I<filename>
505
506 When a certificate is created set its public key to the key in I<filename>
507 instead of the key contained in the input or given with the B<-signkey> option.
508
509 This option is useful for creating self-issued certificates that are not
510 self-signed, for instance when the key cannot be used for signing, such as DH.
511 It can also be used in conjunction with b<-new> and B<-subj> to directly
512 generate a certificate containing any desired public key.
513
514 =item B<-subj> I<arg>
515
516 When a certificate is created set its subject name to the given value.
517
518 The arg must be formatted as C</type0=value0/type1=value1/type2=...>.
519 Special characters may be escaped by C<\> (backslash), whitespace is retained.
520 Empty values are permitted, but the corresponding type will not be included
521 in the certificate.
522 Giving a single C</> will lead to an empty sequence of RDNs (a NULL-DN).
523 Multi-valued RDNs can be formed by placing a C<+> character instead of a C</>
524 between the AttributeValueAssertions (AVAs) that specify the members of the set.
525 Example:
526
527 C</DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe>
528
529 Unless the B<-CA> option is given the issuer is set to the same value.
530
531 This option can be used in conjunction with the B<-force_pubkey> option
532 to create a certificate even without providing an input certificate
533 or certificate request.
534
535 =back
536
537 =head2 Text Options
538
539 As well as customising the name output format, it is also possible to
540 customise the actual fields printed using the B<certopt> options when
541 the B<text> option is present. The default behaviour is to print all fields.
542
543 =over 4
544
545 =item B<compatible>
546
547 Use the old format. This is equivalent to specifying no output options at all.
548
549 =item B<no_header>
550
551 Don't print header information: that is the lines saying "Certificate"
552 and "Data".
553
554 =item B<no_version>
555
556 Don't print out the version number.
557
558 =item B<no_serial>
559
560 Don't print out the serial number.
561
562 =item B<no_signame>
563
564 Don't print out the signature algorithm used.
565
566 =item B<no_validity>
567
568 Don't print the validity, that is the B<notBefore> and B<notAfter> fields.
569
570 =item B<no_subject>
571
572 Don't print out the subject name.
573
574 =item B<no_issuer>
575
576 Don't print out the issuer name.
577
578 =item B<no_pubkey>
579
580 Don't print out the public key.
581
582 =item B<no_sigdump>
583
584 Don't give a hexadecimal dump of the certificate signature.
585
586 =item B<no_aux>
587
588 Don't print out certificate trust information.
589
590 =item B<no_extensions>
591
592 Don't print out any X509V3 extensions.
593
594 =item B<ext_default>
595
596 Retain default extension behaviour: attempt to print out unsupported
597 certificate extensions.
598
599 =item B<ext_error>
600
601 Print an error message for unsupported certificate extensions.
602
603 =item B<ext_parse>
604
605 ASN1 parse unsupported extensions.
606
607 =item B<ext_dump>
608
609 Hex dump unsupported extensions.
610
611 =item B<ca_default>
612
613 The value used by L<openssl-ca(1)>, equivalent to B<no_issuer>, B<no_pubkey>,
614 B<no_header>, and B<no_version>.
615
616 =back
617
618 =head1 EXAMPLES
619
620 Note: in these examples the '\' means the example should be all on one
621 line.
622
623 Display the contents of a certificate:
624
625 openssl x509 -in cert.pem -noout -text
626
627 Display the "Subject Alternative Name" extension of a certificate:
628
629 openssl x509 -in cert.pem -noout -ext subjectAltName
630
631 Display more extensions of a certificate:
632
633 openssl x509 -in cert.pem -noout -ext subjectAltName,nsCertType
634
635 Display the certificate serial number:
636
637 openssl x509 -in cert.pem -noout -serial
638
639 Display the certificate subject name:
640
641 openssl x509 -in cert.pem -noout -subject
642
643 Display the certificate subject name in RFC2253 form:
644
645 openssl x509 -in cert.pem -noout -subject -nameopt RFC2253
646
647 Display the certificate subject name in oneline form on a terminal
648 supporting UTF8:
649
650 openssl x509 -in cert.pem -noout -subject -nameopt oneline,-esc_msb
651
652 Display the certificate SHA1 fingerprint:
653
654 openssl x509 -sha1 -in cert.pem -noout -fingerprint
655
656 Convert a certificate from PEM to DER format:
657
658 openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER
659
660 Convert a certificate to a certificate request:
661
662 openssl x509 -x509toreq -in cert.pem -out req.pem -signkey key.pem
663
664 Convert a certificate request into a self signed certificate using
665 extensions for a CA:
666
667 openssl x509 -req -in careq.pem -extfile openssl.cnf -extensions v3_ca \
668 -signkey key.pem -out cacert.pem
669
670 Sign a certificate request using the CA certificate above and add user
671 certificate extensions:
672
673 openssl x509 -req -in req.pem -extfile openssl.cnf -extensions v3_usr \
674 -CA cacert.pem -CAkey key.pem -CAcreateserial
675
676
677 Set a certificate to be trusted for SSL client use and change set its alias to
678 "Steve's Class 1 CA"
679
680 openssl x509 -in cert.pem -addtrust clientAuth \
681 -setalias "Steve's Class 1 CA" -out trust.pem
682
683 =head1 NOTES
684
685 The conversion to UTF8 format used with the name options assumes that
686 T61Strings use the ISO8859-1 character set. This is wrong but Netscape
687 and MSIE do this as do many certificates. So although this is incorrect
688 it is more likely to display the majority of certificates correctly.
689
690 The B<-email> option searches the subject name and the subject alternative
691 name extension. Only unique email addresses will be printed out: it will
692 not print the same address more than once.
693
694 =head1 CERTIFICATE EXTENSIONS
695
696 The B<-purpose> option checks the certificate extensions and determines
697 what the certificate can be used for. The actual checks done are rather
698 complex and include various hacks and workarounds to handle broken
699 certificates and software.
700
701 The same code is used when verifying untrusted certificates in chains
702 so this section is useful if a chain is rejected by the verify code.
703
704 The basicConstraints extension CA flag is used to determine whether the
705 certificate can be used as a CA. If the CA flag is true then it is a CA,
706 if the CA flag is false then it is not a CA. B<All> CAs should have the
707 CA flag set to true.
708
709 If the basicConstraints extension is absent then the certificate is
710 considered to be a "possible CA" other extensions are checked according
711 to the intended use of the certificate. A warning is given in this case
712 because the certificate should really not be regarded as a CA: however
713 it is allowed to be a CA to work around some broken software.
714
715 If the certificate is a V1 certificate (and thus has no extensions) and
716 it is self signed it is also assumed to be a CA but a warning is again
717 given: this is to work around the problem of Verisign roots which are V1
718 self signed certificates.
719
720 If the keyUsage extension is present then additional restraints are
721 made on the uses of the certificate. A CA certificate B<must> have the
722 keyCertSign bit set if the keyUsage extension is present.
723
724 The extended key usage extension places additional restrictions on the
725 certificate uses. If this extension is present (whether critical or not)
726 the key can only be used for the purposes specified.
727
728 A complete description of each test is given below. The comments about
729 basicConstraints and keyUsage and V1 certificates above apply to B<all>
730 CA certificates.
731
732
733 =over 4
734
735 =item B<SSL Client>
736
737 The extended key usage extension must be absent or include the "web client
738 authentication" OID. keyUsage must be absent or it must have the
739 digitalSignature bit set. Netscape certificate type must be absent or it must
740 have the SSL client bit set.
741
742 =item B<SSL Client CA>
743
744 The extended key usage extension must be absent or include the "web client
745 authentication" OID. Netscape certificate type must be absent or it must have
746 the SSL CA bit set: this is used as a work around if the basicConstraints
747 extension is absent.
748
749 =item B<SSL Server>
750
751 The extended key usage extension must be absent or include the "web server
752 authentication" and/or one of the SGC OIDs. keyUsage must be absent or it
753 must have the digitalSignature, the keyEncipherment set or both bits set.
754 Netscape certificate type must be absent or have the SSL server bit set.
755
756 =item B<SSL Server CA>
757
758 The extended key usage extension must be absent or include the "web server
759 authentication" and/or one of the SGC OIDs. Netscape certificate type must
760 be absent or the SSL CA bit must be set: this is used as a work around if the
761 basicConstraints extension is absent.
762
763 =item B<Netscape SSL Server>
764
765 For Netscape SSL clients to connect to an SSL server it must have the
766 keyEncipherment bit set if the keyUsage extension is present. This isn't
767 always valid because some cipher suites use the key for digital signing.
768 Otherwise it is the same as a normal SSL server.
769
770 =item B<Common S/MIME Client Tests>
771
772 The extended key usage extension must be absent or include the "email
773 protection" OID. Netscape certificate type must be absent or should have the
774 S/MIME bit set. If the S/MIME bit is not set in Netscape certificate type
775 then the SSL client bit is tolerated as an alternative but a warning is shown:
776 this is because some Verisign certificates don't set the S/MIME bit.
777
778 =item B<S/MIME Signing>
779
780 In addition to the common S/MIME client tests the digitalSignature bit or
781 the nonRepudiation bit must be set if the keyUsage extension is present.
782
783 =item B<S/MIME Encryption>
784
785 In addition to the common S/MIME tests the keyEncipherment bit must be set
786 if the keyUsage extension is present.
787
788 =item B<S/MIME CA>
789
790 The extended key usage extension must be absent or include the "email
791 protection" OID. Netscape certificate type must be absent or must have the
792 S/MIME CA bit set: this is used as a work around if the basicConstraints
793 extension is absent.
794
795 =item B<CRL Signing>
796
797 The keyUsage extension must be absent or it must have the CRL signing bit
798 set.
799
800 =item B<CRL Signing CA>
801
802 The normal CA tests apply. Except in this case the basicConstraints extension
803 must be present.
804
805 =back
806
807 =head1 BUGS
808
809 Extensions in certificates are not transferred to certificate requests and
810 vice versa.
811
812 It is possible to produce invalid certificates or requests by specifying the
813 wrong private key or using inconsistent options in some cases: these should
814 be checked.
815
816 There should be options to explicitly set such things as start and end
817 dates rather than an offset from the current time.
818
819 =head1 SEE ALSO
820
821 L<openssl(1)>,
822 L<openssl-req(1)>,
823 L<openssl-ca(1)>,
824 L<openssl-genrsa(1)>,
825 L<openssl-gendsa(1)>,
826 L<openssl-verify(1)>,
827 L<x509v3_config(5)>
828
829 =head1 HISTORY
830
831 The hash algorithm used in the B<-subject_hash> and B<-issuer_hash> options
832 before OpenSSL 1.0.0 was based on the deprecated MD5 algorithm and the encoding
833 of the distinguished name. In OpenSSL 1.0.0 and later it is based on a canonical
834 version of the DN using SHA1. This means that any directories using the old
835 form must have their links rebuilt using L<openssl-rehash(1)> or similar.
836
837 All B<-keyform> and B<-CAkeyform> values except B<ENGINE>
838 have become obsolete in OpenSSL 3.0.0 and have no effect.
839
840 The B<-CAform> option has become obsolete in OpenSSL 3.0.0 and has no effect.
841
842 The B<-engine> option was deprecated in OpenSSL 3.0.
843
844 The B<-C> option was removed in OpenSSL 3.0.
845
846 =head1 COPYRIGHT
847
848 Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
849
850 Licensed under the Apache License 2.0 (the "License"). You may not use
851 this file except in compliance with the License. You can obtain a copy
852 in the file LICENSE in the source distribution or at
853 L<https://www.openssl.org/source/license.html>.
854
855 =cut