summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjmc <>2016-09-22 13:30:49 +0000
committerjmc <>2016-09-22 13:30:49 +0000
commitbe17cc7cacfb36c99f77da01fcf67e8e4232242c (patch)
tree4cf4dd06e94614be61c11c49a59b2d11bde6de59 /src
parent3d3ba707c5ca80bd90ebaa79e16157797d4e4b68 (diff)
downloadopenbsd-be17cc7cacfb36c99f77da01fcf67e8e4232242c.tar.gz
openbsd-be17cc7cacfb36c99f77da01fcf67e8e4232242c.tar.bz2
openbsd-be17cc7cacfb36c99f77da01fcf67e8e4232242c.zip
shorten x509;
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/openssl.11169
1 files changed, 414 insertions, 755 deletions
diff --git a/src/usr.bin/openssl/openssl.1 b/src/usr.bin/openssl/openssl.1
index 6945eadfc1..2fa7a70b69 100644
--- a/src/usr.bin/openssl/openssl.1
+++ b/src/usr.bin/openssl/openssl.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: openssl.1,v 1.79 2016/09/20 16:45:38 jmc Exp $ 1.\" $OpenBSD: openssl.1,v 1.80 2016/09/22 13:30:49 jmc Exp $
2.\" ==================================================================== 2.\" ====================================================================
3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4.\" 4.\"
@@ -112,7 +112,7 @@
112.\" 112.\"
113.\" OPENSSL 113.\" OPENSSL
114.\" 114.\"
115.Dd $Mdocdate: September 20 2016 $ 115.Dd $Mdocdate: September 22 2016 $
116.Dt OPENSSL 1 116.Dt OPENSSL 1
117.Os 117.Os
118.Sh NAME 118.Sh NAME
@@ -1956,12 +1956,6 @@ and prints out the certificates contained in it,
1956or takes a file of certificates 1956or takes a file of certificates
1957and converts it into a Netscape certificate sequence. 1957and converts it into a Netscape certificate sequence.
1958.Pp 1958.Pp
1959The PEM-encoded form uses the same headers and footers as a certificate:
1960.Bd -unfilled -offset indent
1961-----BEGIN CERTIFICATE-----
1962-----END CERTIFICATE-----
1963.Ed
1964.Pp
1965The options are as follows: 1959The options are as follows:
1966.Bl -tag -width Ds 1960.Bl -tag -width Ds
1967.It Fl in Ar file 1961.It Fl in Ar file
@@ -2452,19 +2446,6 @@ The default encryption is only 56 bits;
2452keys encrypted using PKCS#5 v2.0 algorithms and high iteration counts 2446keys encrypted using PKCS#5 v2.0 algorithms and high iteration counts
2453are more secure. 2447are more secure.
2454.Pp 2448.Pp
2455The encrypted form of a PEM-encoded PKCS#8 file uses the following
2456headers and footers:
2457.Bd -unfilled -offset indent
2458-----BEGIN ENCRYPTED PRIVATE KEY-----
2459-----END ENCRYPTED PRIVATE KEY-----
2460.Ed
2461.Pp
2462The unencrypted form uses:
2463.Bd -unfilled -offset indent
2464-----BEGIN PRIVATE KEY-----
2465-----END PRIVATE KEY-----
2466.Ed
2467.Pp
2468The options are as follows: 2449The options are as follows:
2469.Bl -tag -width Ds 2450.Bl -tag -width Ds
2470.It Fl embed 2451.It Fl embed
@@ -5347,22 +5328,18 @@ The current
5347.Nm openssl 5328.Nm openssl
5348version. 5329version.
5349.El 5330.El
5350.\"
5351.\" X509
5352.\"
5353.Sh X509 5331.Sh X509
5354.nr nS 1 5332.nr nS 1
5355.Nm "openssl x509" 5333.Nm "openssl x509"
5356.Bk -words
5357.Op Fl C 5334.Op Fl C
5358.Op Fl addreject Ar arg 5335.Op Fl addreject Ar arg
5359.Op Fl addtrust Ar arg 5336.Op Fl addtrust Ar arg
5360.Op Fl alias 5337.Op Fl alias
5361.Op Fl CA Ar file 5338.Op Fl CA Ar file
5362.Op Fl CAcreateserial 5339.Op Fl CAcreateserial
5363.Op Fl CAform Ar DER | PEM 5340.Op Fl CAform Cm der | pem
5364.Op Fl CAkey Ar file 5341.Op Fl CAkey Ar file
5365.Op Fl CAkeyform Ar DER | PEM 5342.Op Fl CAkeyform Cm der | pem
5366.Op Fl CAserial Ar file 5343.Op Fl CAserial Ar file
5367.Op Fl certopt Ar option 5344.Op Fl certopt Ar option
5368.Op Fl checkend Ar arg 5345.Op Fl checkend Ar arg
@@ -5378,11 +5355,11 @@ version.
5378.Op Fl fingerprint 5355.Op Fl fingerprint
5379.Op Fl hash 5356.Op Fl hash
5380.Op Fl in Ar file 5357.Op Fl in Ar file
5381.Op Fl inform Ar DER | NET | PEM 5358.Op Fl inform Cm der | net | pem
5382.Op Fl issuer 5359.Op Fl issuer
5383.Op Fl issuer_hash 5360.Op Fl issuer_hash
5384.Op Fl issuer_hash_old 5361.Op Fl issuer_hash_old
5385.Op Fl keyform Ar DER | PEM 5362.Op Fl keyform Cm der | pem
5386.Op Fl md5 | sha1 5363.Op Fl md5 | sha1
5387.Op Fl modulus 5364.Op Fl modulus
5388.Op Fl nameopt Ar option 5365.Op Fl nameopt Ar option
@@ -5390,7 +5367,7 @@ version.
5390.Op Fl ocsp_uri 5367.Op Fl ocsp_uri
5391.Op Fl ocspid 5368.Op Fl ocspid
5392.Op Fl out Ar file 5369.Op Fl out Ar file
5393.Op Fl outform Ar DER | NET | PEM 5370.Op Fl outform Cm der | net | pem
5394.Op Fl passin Ar arg 5371.Op Fl passin Ar arg
5395.Op Fl pubkey 5372.Op Fl pubkey
5396.Op Fl purpose 5373.Op Fl purpose
@@ -5406,7 +5383,6 @@ version.
5406.Op Fl text 5383.Op Fl text
5407.Op Fl trustout 5384.Op Fl trustout
5408.Op Fl x509toreq 5385.Op Fl x509toreq
5409.Ek
5410.nr nS 0 5386.nr nS 0
5411.Pp 5387.Pp
5412The 5388The
@@ -5417,29 +5393,17 @@ various forms, sign certificate requests like a
5417.Qq mini CA , 5393.Qq mini CA ,
5418or edit certificate trust settings. 5394or edit certificate trust settings.
5419.Pp 5395.Pp
5420Since there are a large number of options, they are split up into 5396The following are x509 input, output, and general purpose options:
5421various sections.
5422.Sh X509 INPUT, OUTPUT, AND GENERAL PURPOSE OPTIONS
5423.Bl -tag -width "XXXX" 5397.Bl -tag -width "XXXX"
5424.It Fl in Ar file 5398.It Fl in Ar file
5425This specifies the input 5399The input file to read from,
5426.Ar file 5400or standard input if not specified.
5427to read a certificate from, or standard input if this option is not specified. 5401.It Fl inform Cm der | net | pem
5428.It Fl inform Ar DER | NET | PEM 5402The input format.
5429This specifies the input format.
5430Normally, the command will expect an X.509 certificate, 5403Normally, the command will expect an X.509 certificate,
5431but this can change if other options such as 5404but this can change if other options such as
5432.Fl req 5405.Fl req
5433are present. 5406are present.
5434The
5435.Ar DER
5436format is the DER encoding of the certificate and
5437.Ar PEM
5438is the base64 encoding of the DER encoding with header and footer lines added.
5439The
5440.Ar NET
5441option is an obscure Netscape server format that is now
5442obsolete.
5443.It Fl md5 | sha1 5407.It Fl md5 | sha1
5444The digest to use. 5408The digest to use.
5445This affects any signing or display option that uses a message digest, 5409This affects any signing or display option that uses a message digest,
@@ -5449,215 +5413,447 @@ and
5449.Fl CA 5413.Fl CA
5450options. 5414options.
5451If not specified, MD5 is used. 5415If not specified, MD5 is used.
5452If the key being used to sign with is a DSA key, 5416SHA1 is always used with DSA keys.
5453this option has no effect: SHA1 is always used with DSA keys.
5454.It Fl out Ar file 5417.It Fl out Ar file
5455This specifies the output 5418The output file to write to,
5456.Ar file 5419or standard output if none is specified.
5457to write to, or standard output by default. 5420.It Fl outform Cm der | net | pem
5458.It Fl outform Ar DER | NET | PEM 5421The output format.
5459This specifies the output format; the options have the same meaning as the
5460.Fl inform
5461option.
5462.It Fl passin Ar arg 5422.It Fl passin Ar arg
5463The key password source. 5423The key password source.
5464.El 5424.El
5465.Sh X509 DISPLAY OPTIONS 5425.Pp
5466.Sy Note : 5426The following are x509 display options:
5467The
5468.Fl alias
5469and
5470.Fl purpose
5471options are also display options but are described in the
5472.Sx X509 TRUST SETTINGS
5473section.
5474.Bl -tag -width "XXXX" 5427.Bl -tag -width "XXXX"
5475.It Fl C 5428.It Fl C
5476This outputs the certificate in the form of a C source file. 5429Output the certificate in the form of a C source file.
5477.It Fl certopt Ar option 5430.It Fl certopt Ar option
5478Customise the output format used with 5431Customise the output format used with
5479.Fl text . 5432.Fl text ,
5480The 5433either using a list of comma-separated options or by specifying
5481.Ar option
5482argument can be a single option or multiple options separated by commas.
5483The
5484.Fl certopt 5434.Fl certopt
5485switch may also be used more than once to set multiple options. 5435multiple times.
5486See the 5436The default behaviour is to print all fields.
5487.Sx X509 TEXT OPTIONS 5437The options are as follows:
5488section for more information. 5438.Pp
5439.Bl -tag -width "no_extensions" -offset indent -compact
5440.It Cm ca_default
5441Equivalent to
5442.Cm no_issuer , no_pubkey , no_header ,
5443.Cm no_version , no_sigdump ,
5444and
5445.Cm no_signame .
5446.It Cm compatible
5447Equivalent to no output options at all.
5448.It Cm ext_default
5449Print unsupported certificate extensions.
5450.It Cm ext_dump
5451Hex dump unsupported extensions.
5452.It Cm ext_error
5453Print an error message for unsupported certificate extensions.
5454.It Cm ext_parse
5455ASN1 parse unsupported extensions.
5456.It Cm no_aux
5457Do not print certificate trust information.
5458.It Cm no_extensions
5459Do not print X509V3 extensions.
5460.It Cm no_header
5461Do not print header (Certificate and Data) information.
5462.It Cm no_issuer
5463Do not print the issuer name.
5464.It Cm no_pubkey
5465Do not print the public key.
5466.It Cm no_serial
5467Do not print the serial number.
5468.It Cm no_sigdump
5469Do not give a hexadecimal dump of the certificate signature.
5470.It Cm no_signame
5471Do not print the signature algorithm used.
5472.It Cm no_subject
5473Do not print the subject name.
5474.It Cm no_validity
5475Do not print the
5476.Cm notBefore
5477and
5478.Cm notAfter
5479(validity) fields.
5480.It Cm no_version
5481Do not print the version number.
5482.El
5489.It Fl dates 5483.It Fl dates
5490Prints out the start and expiry dates of a certificate. 5484Print the start and expiry date of a certificate.
5491.It Fl email 5485.It Fl email
5492Outputs the email address(es), if any. 5486Output the email addresses, if any.
5493.It Fl enddate 5487.It Fl enddate
5494Prints out the expiry date of the certificate; that is, the 5488Print the expiry date of the certificate; that is, the
5495.Em notAfter 5489.Cm notAfter
5496date. 5490date.
5497.It Fl fingerprint 5491.It Fl fingerprint
5498Prints out the digest of the DER-encoded version of the whole certificate 5492Print the digest of the DER-encoded version of the whole certificate.
5499(see
5500.Sx DIGEST OPTIONS ) .
5501.It Fl hash 5493.It Fl hash
5502A synonym for 5494A synonym for
5503.Fl subject_hash , 5495.Fl subject_hash .
5504for backwards compatibility.
5505.It Fl issuer 5496.It Fl issuer
5506Outputs the issuer name. 5497Print the issuer name.
5507.It Fl issuer_hash 5498.It Fl issuer_hash
5508Outputs the 5499Print the hash of the certificate issuer name.
5509.Qq hash
5510of the certificate issuer name.
5511.It Fl issuer_hash_old 5500.It Fl issuer_hash_old
5512Outputs the 5501Print the hash of the certificate issuer name
5513.Qq hash 5502using the older algorithm as used by
5514of the certificate issuer name using the older algorithm 5503.Nm openssl
5515as used by
5516.Nm OpenSSL
5517versions before 1.0.0. 5504versions before 1.0.0.
5518.It Fl modulus 5505.It Fl modulus
5519This option prints out the value of the modulus of the public key 5506Print the value of the modulus of the public key contained in the certificate.
5520contained in the certificate.
5521.It Fl nameopt Ar option 5507.It Fl nameopt Ar option
5522Option which determines how the subject or issuer names are displayed. 5508Customise how the subject or issuer names are displayed,
5523The 5509either using a list of comma-separated options or by specifying
5524.Ar option
5525argument can be a single option or multiple options separated by commas.
5526Alternatively, the
5527.Fl nameopt 5510.Fl nameopt
5528switch may be used more than once to set multiple options. 5511multiple times.
5529See the 5512The default behaviour is to use the
5530.Sx X509 NAME OPTIONS 5513.Cm oneline
5531section for more information. 5514format.
5515The options,
5516which can be preceded by a dash to turn them off,
5517are as follows:
5518.Bl -tag -width "XXXX"
5519.It Cm align
5520Align field values for a more readable output.
5521Only usable with
5522.Ar sep_multiline .
5523.It Cm compat
5524Use the old format,
5525equivalent to specifying no options at all.
5526.It Cm dn_rev
5527Reverse the fields of the DN, as required by RFC 2253.
5528As a side effect, this also reverses the order of multiple AVAs.
5529.It Cm dump_all
5530Dump all fields.
5531When used with
5532.Ar dump_der ,
5533it allows the DER encoding of the structure to be unambiguously determined.
5534.It Cm dump_der
5535Any fields that need to be hexdumped are
5536dumped using the DER encoding of the field.
5537Otherwise just the content octets will be displayed.
5538Both options use the RFC 2253 #XXXX... format.
5539.It Cm dump_nostr
5540Dump non-character string types
5541(for example OCTET STRING);
5542usually, non-character string types are displayed
5543as though each content octet represents a single character.
5544.It Cm dump_unknown
5545Dump any field whose OID is not recognised by
5546.Nm openssl .
5547.It Cm esc_2253
5548Escape the
5549.Qq special
5550characters required by RFC 2253 in a field that is
5551.Dq \& ,+"<>; .
5552Additionally,
5553.Sq #
5554is escaped at the beginning of a string
5555and a space character at the beginning or end of a string.
5556.It Cm esc_ctrl
5557Escape control characters.
5558That is, those with ASCII values less than 0x20 (space)
5559and the delete (0x7f) character.
5560They are escaped using the RFC 2253 \eXX notation (where XX are two hex
5561digits representing the character value).
5562.It Cm esc_msb
5563Escape characters with the MSB set; that is, with ASCII values larger than
5564127.
5565.It Cm multiline
5566A multiline format.
5567Equivalent to
5568.Cm esc_ctrl , esc_msb , sep_multiline ,
5569.Cm space_eq , lname ,
5570and
5571.Cm align .
5572.It Cm no_type
5573Do not attempt to interpret multibyte characters.
5574That is, content octets are merely dumped as though one octet
5575represents each character.
5576This is useful for diagnostic purposes
5577but results in rather odd looking output.
5578.It Cm nofname , sname , lname , oid
5579Alter how the field name is displayed:
5580.Cm nofname
5581does not display the field at all;
5582.Cm sname
5583uses the short name form (CN for
5584.Cm commonName ,
5585for example);
5586.Cm lname
5587uses the long form.
5588.Cm oid
5589represents the OID in numerical form and is useful for diagnostic purpose.
5590.It Cm oneline
5591A one line format which is more readable than
5592.Cm RFC2253 .
5593Equivalent to
5594.Cm esc_2253 , esc_ctrl , esc_msb , utf8 ,
5595.Cm dump_nostr , dump_der , use_quote , sep_comma_plus_spc ,
5596.Cm space_eq ,
5597and
5598.Cm sname .
5599.It Cm RFC2253
5600Displays names compatible with RFC 2253.
5601Equivalent to
5602.Cm esc_2253 , esc_ctrl ,
5603.Cm esc_msb , utf8 , dump_nostr , dump_unknown ,
5604.Cm dump_der , sep_comma_plus , dn_rev ,
5605and
5606.Cm sname .
5607.It Cm sep_comma_plus , sep_comma_plus_space , sep_semi_plus_space , sep_multiline
5608Determine the field separators:
5609the first character is between RDNs and the second between multiple AVAs
5610(multiple AVAs are very rare and their use is discouraged).
5611The options ending in
5612.Qq space
5613additionally place a space after the separator to make it more readable.
5614.Cm sep_multiline
5615uses a linefeed character for the RDN separator and a spaced
5616.Sq +
5617for the AVA separator,
5618as well as indenting the fields by four characters.
5619.It Cm show_type
5620Show the type of the ASN1 character string.
5621The type precedes the field contents.
5622For example
5623.Qq BMPSTRING: Hello World .
5624.It Cm space_eq
5625Place spaces round the
5626.Sq =
5627character which follows the field name.
5628.It Cm use_quote
5629Escape some characters by surrounding the whole string with
5630.Sq \&"
5631characters.
5632Without the option, all escaping is done with the
5633.Sq \e
5634character.
5635.It Cm utf8
5636Convert all strings to UTF8 format first, as required by RFC 2253.
5637On a UTF8 compatible terminal,
5638the use of this option (and not setting
5639.Cm esc_msb )
5640may result in the correct display of multibyte characters.
5641Usually, multibyte characters larger than 0xff
5642are represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX
5643for 32 bits,
5644and any UTF8Strings are converted to their character form first.
5645.El
5532.It Fl noout 5646.It Fl noout
5533This option prevents output of the encoded version of the request. 5647Do not output the encoded version of the request.
5534.It Fl ocsp_uri 5648.It Fl ocsp_uri
5535Outputs the OCSP responder addresses, if any. 5649Print the OCSP responder addresses, if any.
5536.It Fl ocspid 5650.It Fl ocspid
5537Print OCSP hash values for the subject name and public key. 5651Print OCSP hash values for the subject name and public key.
5538.It Fl pubkey 5652.It Fl pubkey
5539Output the public key. 5653Print the public key.
5540.It Fl serial 5654.It Fl serial
5541Outputs the certificate serial number. 5655Print the certificate serial number.
5542.It Fl startdate 5656.It Fl startdate
5543Prints out the start date of the certificate; that is, the 5657Print the start date of the certificate; that is, the
5544.Em notBefore 5658.Cm notBefore
5545date. 5659date.
5546.It Fl subject 5660.It Fl subject
5547Outputs the subject name. 5661Print the subject name.
5548.It Fl subject_hash 5662.It Fl subject_hash
5549Outputs the 5663Print the hash of the certificate subject name.
5550.Qq hash
5551of the certificate subject name.
5552This is used in 5664This is used in
5553.Nm OpenSSL 5665.Nm openssl
5554to form an index to allow certificates in a directory to be looked up 5666to form an index to allow certificates in a directory to be looked up
5555by subject name. 5667by subject name.
5556.It Fl subject_hash_old 5668.It Fl subject_hash_old
5557Outputs the 5669Print the hash of the certificate subject name
5558.Qq hash 5670using the older algorithm as used by
5559of the certificate subject name using the older algorithm 5671.Nm openssl
5560as used by
5561.Nm OpenSSL
5562versions before 1.0.0. 5672versions before 1.0.0.
5563.It Fl text 5673.It Fl text
5564Prints out the certificate in text form. 5674Print the full certificate in text form.
5565Full details are output including the public key, signature algorithms,
5566issuer and subject names, serial number, any extensions present,
5567and any trust settings.
5568.El 5675.El
5569.Sh X509 TRUST SETTINGS
5570Please note these options are currently experimental and may well change.
5571.Pp 5676.Pp
5572A 5677A trusted certificate is a certificate which has several
5573.Em trusted certificate
5574is an ordinary certificate which has several
5575additional pieces of information attached to it such as the permitted 5678additional pieces of information attached to it such as the permitted
5576and prohibited uses of the certificate and an 5679and prohibited uses of the certificate and an alias.
5577.Qq alias . 5680When a certificate is being verified at least one certificate must be trusted.
5578.Pp 5681By default, a trusted certificate must be stored locally and be a root CA.
5579Normally, when a certificate is being verified at least one certificate 5682The following are x509 trust settings options:
5580must be
5581.Qq trusted .
5582By default, a trusted certificate must be stored
5583locally and must be a root CA: any certificate chain ending in this CA
5584is then usable for any purpose.
5585.Pp
5586Trust settings currently are only used with a root CA.
5587They allow a finer control over the purposes the root CA can be used for.
5588For example, a CA may be trusted for an SSL client but not for
5589SSL server use.
5590.Pp
5591See the description of the
5592.Nm verify
5593utility for more information on the meaning of trust settings.
5594.Pp
5595Future versions of
5596.Nm OpenSSL
5597will recognize trust settings on any certificate: not just root CAs.
5598.Bl -tag -width "XXXX" 5683.Bl -tag -width "XXXX"
5599.It Fl addreject Ar arg 5684.It Fl addreject Ar arg
5600Adds a prohibited use. 5685Add a prohibited use.
5601It accepts the same values as the 5686Accepts the same values as the
5602.Fl addtrust 5687.Fl addtrust
5603option. 5688option.
5604.It Fl addtrust Ar arg 5689.It Fl addtrust Ar arg
5605Adds a trusted certificate use. 5690Add a trusted certificate use.
5606Any object name can be used here, but currently only 5691Any object name can be used here, but currently only
5607.Ar clientAuth 5692.Cm clientAuth
5608.Pq SSL client use , 5693(SSL client use),
5609.Ar serverAuth 5694.Cm serverAuth
5610.Pq SSL server use , 5695(SSL server use),
5611and 5696and
5612.Ar emailProtection 5697.Cm emailProtection
5613.Pq S/MIME email 5698(S/MIME email) are used.
5614are used.
5615Other
5616.Nm OpenSSL
5617applications may define additional uses.
5618.It Fl alias 5699.It Fl alias
5619Outputs the certificate alias, if any. 5700Output the certificate alias.
5620.It Fl clrreject 5701.It Fl clrreject
5621Clears all the prohibited or rejected uses of the certificate. 5702Clear all the prohibited or rejected uses of the certificate.
5622.It Fl clrtrust 5703.It Fl clrtrust
5623Clears all the permitted or trusted uses of the certificate. 5704Clear all the permitted or trusted uses of the certificate.
5624.It Fl purpose 5705.It Fl purpose
5625This option performs tests on the certificate extensions and outputs 5706Perform tests on the certificate extensions.
5626the results. 5707The same code is used when verifying untrusted certificates in chains,
5627For a more complete description, see the 5708so this section is useful if a chain is rejected by the verify code.
5628.Sx X.509 CERTIFICATE EXTENSIONS 5709.Pp
5629section. 5710The
5711.Cm basicConstraints
5712extension CA flag is used to determine whether the
5713certificate can be used as a CA.
5714If the CA flag is true, it is a CA;
5715if the CA flag is false, it is not a CA.
5716All CAs should have the CA flag set to true.
5717.Pp
5718If the
5719.Cm basicConstraints
5720extension is absent, then the certificate is
5721considered to be a possible CA;
5722other extensions are checked according to the intended use of the certificate.
5723A warning is given in this case because the certificate should really not
5724be regarded as a CA.
5725However it is allowed to be a CA to work around some broken software.
5726.Pp
5727If the certificate is a V1 certificate
5728(and thus has no extensions) and it is self-signed,
5729it is also assumed to be a CA but a warning is again given.
5730This is to work around the problem of Verisign roots
5731which are V1 self-signed certificates.
5732.Pp
5733If the
5734.Cm keyUsage
5735extension is present, then additional restraints are
5736made on the uses of the certificate.
5737A CA certificate must have the
5738.Cm keyCertSign
5739bit set if the
5740.Cm keyUsage
5741extension is present.
5742.Pp
5743The extended key usage extension places additional restrictions on the
5744certificate uses.
5745If this extension is present, whether critical or not,
5746the key can only be used for the purposes specified.
5747.Pp
5748A complete description of each test is given below.
5749The comments about
5750.Cm basicConstraints
5751and
5752.Cm keyUsage
5753and V1 certificates above apply to all CA certificates.
5754.Bl -tag -width "XXXX"
5755.It SSL Client
5756The extended key usage extension must be absent or include the
5757web client authentication OID.
5758.Cm keyUsage
5759must be absent or it must have the
5760.Cm digitalSignature
5761bit set.
5762The Netscape certificate type must be absent
5763or it must have the SSL client bit set.
5764.It SSL Client CA
5765The extended key usage extension must be absent or include the
5766web client authentication OID.
5767The Netscape certificate type must be absent
5768or it must have the SSL CA bit set:
5769this is used as a workaround if the
5770.Cm basicConstraints
5771extension is absent.
5772.It SSL Server
5773The extended key usage extension must be absent or include the
5774web server authentication and/or one of the SGC OIDs.
5775.Cm keyUsage
5776must be absent or it must have the
5777.Cm digitalSignature
5778set, the
5779.Cm keyEncipherment
5780set, or both bits set.
5781The Netscape certificate type must be absent or have the SSL server bit set.
5782.It SSL Server CA
5783The extended key usage extension must be absent or include the
5784web server authentication and/or one of the SGC OIDs.
5785The Netscape certificate type must be absent or the SSL CA bit must be set:
5786this is used as a workaround if the
5787.Cm basicConstraints
5788extension is absent.
5789.It Netscape SSL Server
5790For Netscape SSL clients to connect to an SSL server; it must have the
5791.Cm keyEncipherment
5792bit set if the
5793.Cm keyUsage
5794extension is present.
5795This isn't always valid because some cipher suites use the key for
5796digital signing.
5797Otherwise it is the same as a normal SSL server.
5798.It Common S/MIME Client Tests
5799The extended key usage extension must be absent or include the
5800email protection OID.
5801The Netscape certificate type must be absent or should have the S/MIME bit set.
5802If the S/MIME bit is not set in Netscape certificate type, then the SSL
5803client bit is tolerated as an alternative but a warning is shown:
5804this is because some Verisign certificates don't set the S/MIME bit.
5805.It S/MIME Signing
5806In addition to the common S/MIME client tests, the
5807.Cm digitalSignature
5808bit must be set if the
5809.Cm keyUsage
5810extension is present.
5811.It S/MIME Encryption
5812In addition to the common S/MIME tests, the
5813.Cm keyEncipherment
5814bit must be set if the
5815.Cm keyUsage
5816extension is present.
5817.It S/MIME CA
5818The extended key usage extension must be absent or include the
5819email protection OID.
5820The Netscape certificate type must be absent
5821or must have the S/MIME CA bit set:
5822this is used as a workaround if the
5823.Cm basicConstraints
5824extension is absent.
5825.It CRL Signing
5826The
5827.Cm keyUsage
5828extension must be absent or it must have the CRL signing bit set.
5829.It CRL Signing CA
5830The normal CA tests apply, except the
5831.Cm basicConstraints
5832extension must be present.
5833.El
5630.It Fl setalias Ar arg 5834.It Fl setalias Ar arg
5631Sets the alias of the certificate. 5835Set the alias of the certificate,
5632This will allow the certificate to be referred to using a nickname, 5836allowing the certificate to be referred to using a nickname,
5633for example 5837such as
5634.Qq Steve's Certificate . 5838.Qq Steve's Certificate .
5635.It Fl trustout 5839.It Fl trustout
5636This causes 5840Output a trusted certificate
5637.Nm x509 5841(the default if any trust settings are modified).
5638to output a
5639.Em trusted certificate .
5640An ordinary or trusted certificate can be input, but by default an ordinary 5842An ordinary or trusted certificate can be input, but by default an ordinary
5641certificate is output and any trust settings are discarded. 5843certificate is output and any trust settings are discarded.
5642With the
5643.Fl trustout
5644option a trusted certificate is output.
5645A trusted certificate is automatically output if any trust settings
5646are modified.
5647.El 5844.El
5648.Sh X509 SIGNING OPTIONS 5845.Pp
5649The 5846The
5650.Nm x509 5847.Nm x509
5651utility can be used to sign certificates and requests: it 5848utility can be used to sign certificates and requests:
5652can thus behave like a 5849it can thus behave like a mini CA.
5653.Qq mini CA . 5850The following are x509 signing options:
5654.Bl -tag -width "XXXX" 5851.Bl -tag -width "XXXX"
5655.It Fl CA Ar file 5852.It Fl CA Ar file
5656Specifies the CA certificate to be used for signing. 5853The CA certificate to be used for signing.
5657When this option is present, 5854When this option is present,
5658.Nm x509 5855.Nm x509
5659behaves like a 5856behaves like a mini CA.
5660.Qq mini CA .
5661The input file is signed by the CA using this option; 5857The input file is signed by the CA using this option;
5662that is, its issuer name is set to the subject name of the CA and it is 5858that is, its issuer name is set to the subject name of the CA and it is
5663digitally signed using the CA's private key. 5859digitally signed using the CA's private key.
@@ -5669,35 +5865,30 @@ Without the
5669.Fl req 5865.Fl req
5670option, the input is a certificate which must be self-signed. 5866option, the input is a certificate which must be self-signed.
5671.It Fl CAcreateserial 5867.It Fl CAcreateserial
5672With this option the CA serial number file is created if it does not exist: 5868Create the CA serial number file if it does not exist
5673it will contain the serial number 5869instead of generating an error.
5870The file will contain the serial number
5674.Sq 02 5871.Sq 02
5675and the certificate being signed will have 5872and the certificate being signed will have
5676.Sq 1 5873.Sq 1
5677as its serial number. 5874as its serial number.
5678Normally, if the 5875.It Fl CAform Cm der | pem
5679.Fl CA
5680option is specified and the serial number file does not exist, it is an error.
5681.It Fl CAform Ar DER | PEM
5682The format of the CA certificate file. 5876The format of the CA certificate file.
5683The default is 5877The default is
5684.Ar PEM . 5878.Cm pem .
5685.It Fl CAkey Ar file 5879.It Fl CAkey Ar file
5686Sets the CA private key to sign a certificate with. 5880Set the CA private key to sign a certificate with.
5687If this option is not specified, it is assumed that the CA private key 5881Otherwise it is assumed that the CA private key is present
5688is present in the CA certificate file. 5882in the CA certificate file.
5689.It Fl CAkeyform Ar DER | PEM 5883.It Fl CAkeyform Cm der | pem
5690The format of the CA private key. 5884The format of the CA private key.
5691The default is 5885The default is
5692.Ar PEM . 5886.Cm pem .
5693.It Fl CAserial Ar file 5887.It Fl CAserial Ar file
5694Sets the CA serial number file to use. 5888Use the serial number in
5695.Pp 5889.Ar file
5696When the 5890to sign a certificate.
5697.Fl CA 5891The file should consist of one line containing an even number of hex digits
5698option is used to sign a certificate,
5699it uses a serial number specified in a file.
5700This file consists of one line containing an even number of hex digits
5701with the serial number to use. 5892with the serial number to use.
5702After each use the serial number is incremented and written out 5893After each use the serial number is incremented and written out
5703to the file again. 5894to the file again.
@@ -5725,30 +5916,26 @@ or the
5725options). 5916options).
5726Normally, all extensions are retained. 5917Normally, all extensions are retained.
5727.It Fl days Ar arg 5918.It Fl days Ar arg
5728Specifies the number of days to make a certificate valid for. 5919The number of days to make a certificate valid for.
5729The default is 30 days. 5920The default is 30 days.
5730.It Fl extensions Ar section 5921.It Fl extensions Ar section
5731The section to add certificate extensions from. 5922The section to add certificate extensions from.
5732If this option is not specified, the extensions should either be 5923If this option is not specified, the extensions should either be
5733contained in the unnamed 5924contained in the unnamed (default) section
5734.Pq default 5925or the default section should contain a variable called
5735section or the default section should contain a variable called
5736.Qq extensions 5926.Qq extensions
5737which contains the section to use. 5927which contains the section to use.
5738.It Fl extfile Ar file 5928.It Fl extfile Ar file
5739File containing certificate extensions to use. 5929File containing certificate extensions to use.
5740If not specified, no extensions are added to the certificate. 5930If not specified, no extensions are added to the certificate.
5741.It Fl keyform Ar DER | PEM 5931.It Fl keyform Cm der | pem
5742Specifies the format 5932The format of the private key file used in the
5743.Pq DER or PEM
5744of the private key file used in the
5745.Fl signkey 5933.Fl signkey
5746option. 5934option.
5747.It Fl req 5935.It Fl req
5748By default, a certificate is expected on input. 5936Expect a certificate request on input instead of a certificate.
5749With this option a certificate request is expected instead.
5750.It Fl set_serial Ar n 5937.It Fl set_serial Ar n
5751Specifies the serial number to use. 5938The serial number to use.
5752This option can be used with either the 5939This option can be used with either the
5753.Fl signkey 5940.Fl signkey
5754or 5941or
@@ -5766,12 +5953,12 @@ The serial number can be decimal or hex (if preceded by
5766.Sq 0x ) . 5953.Sq 0x ) .
5767Negative serial numbers can also be specified but their use is not recommended. 5954Negative serial numbers can also be specified but their use is not recommended.
5768.It Fl signkey Ar file 5955.It Fl signkey Ar file
5769This option causes the input file to be self-signed using the supplied 5956Self-sign
5770private key. 5957.Ar file
5958using the supplied private key.
5771.Pp 5959.Pp
5772If the input file is a certificate, it sets the issuer name to the 5960If the input file is a certificate, it sets the issuer name to the
5773subject name 5961subject name (i.e. makes it self-signed),
5774.Pq i.e. makes it self-signed ,
5775changes the public key to the supplied value, 5962changes the public key to the supplied value,
5776and changes the start and end dates. 5963and changes the start and end dates.
5777The start date is set to the current time and the end date is set to 5964The start date is set to the current time and the end date is set to
@@ -5786,539 +5973,11 @@ If the input is a certificate request, a self-signed certificate
5786is created using the supplied private key using the subject name in 5973is created using the supplied private key using the subject name in
5787the request. 5974the request.
5788.It Fl x509toreq 5975.It Fl x509toreq
5789Converts a certificate into a certificate request. 5976Convert a certificate into a certificate request.
5790The 5977The
5791.Fl signkey 5978.Fl signkey
5792option is used to pass the required private key. 5979option is used to pass the required private key.
5793.El 5980.El
5794.Sh X509 NAME OPTIONS
5795The
5796.Fl nameopt
5797command line switch determines how the subject and issuer
5798names are displayed.
5799If no
5800.Fl nameopt
5801switch is present, the default
5802.Qq oneline
5803format is used which is compatible with previous versions of
5804.Nm OpenSSL .
5805Each option is described in detail below; all options can be preceded by a
5806.Sq -
5807to turn the option off.
5808Only
5809.Ar compat ,
5810.Ar RFC2253 ,
5811.Ar oneline ,
5812and
5813.Ar multiline
5814will normally be used.
5815.Bl -tag -width "XXXX"
5816.It Ar align
5817Align field values for a more readable output.
5818Only usable with
5819.Ar sep_multiline .
5820.It Ar compat
5821Use the old format.
5822This is equivalent to specifying no name options at all.
5823.It Ar dn_rev
5824Reverse the fields of the DN.
5825This is required by RFC 2253.
5826As a side effect, this also reverses the order of multiple AVAs but this is
5827permissible.
5828.It Ar dump_all
5829Dump all fields.
5830This option, when used with
5831.Ar dump_der ,
5832allows the DER encoding of the structure to be unambiguously determined.
5833.It Ar dump_der
5834When this option is set, any fields that need to be hexdumped will
5835be dumped using the DER encoding of the field.
5836Otherwise just the content octets will be displayed.
5837Both options use the RFC 2253 #XXXX... format.
5838.It Ar dump_nostr
5839Dump non-character string types
5840.Pq for example OCTET STRING ;
5841if this option is not set, non-character string types will be displayed
5842as though each content octet represents a single character.
5843.It Ar dump_unknown
5844Dump any field whose OID is not recognised by
5845.Nm OpenSSL .
5846.It Ar esc_2253
5847Escape the
5848.Qq special
5849characters required by RFC 2253 in a field that is
5850.Dq \& ,+"\*(Lt\*(Gt; .
5851Additionally,
5852.Sq #
5853is escaped at the beginning of a string
5854and a space character at the beginning or end of a string.
5855.It Ar esc_ctrl
5856Escape control characters.
5857That is, those with ASCII values less than 0x20
5858.Pq space
5859and the delete
5860.Pq 0x7f
5861character.
5862They are escaped using the RFC 2253 \eXX notation (where XX are two hex
5863digits representing the character value).
5864.It Ar esc_msb
5865Escape characters with the MSB set; that is, with ASCII values larger than
5866127.
5867.It Ar multiline
5868A multiline format.
5869It is equivalent to
5870.Ar esc_ctrl , esc_msb , sep_multiline ,
5871.Ar space_eq , lname ,
5872and
5873.Ar align .
5874.It Ar no_type
5875This option does not attempt to interpret multibyte characters in any
5876way.
5877That is, their content octets are merely dumped as though one octet
5878represents each character.
5879This is useful for diagnostic purposes but will result in rather odd
5880looking output.
5881.It Ar nofname , sname , lname , oid
5882These options alter how the field name is displayed.
5883.Ar nofname
5884does not display the field at all.
5885.Ar sname
5886uses the
5887.Qq short name
5888form (CN for
5889.Ar commonName ,
5890for example).
5891.Ar lname
5892uses the long form.
5893.Ar oid
5894represents the OID in numerical form and is useful for diagnostic purpose.
5895.It Ar oneline
5896A oneline format which is more readable than
5897.Ar RFC2253 .
5898It is equivalent to specifying the
5899.Ar esc_2253 , esc_ctrl , esc_msb , utf8 ,
5900.Ar dump_nostr , dump_der , use_quote , sep_comma_plus_spc ,
5901.Ar space_eq ,
5902and
5903.Ar sname
5904options.
5905.It Ar RFC2253
5906Displays names compatible with RFC 2253; equivalent to
5907.Ar esc_2253 , esc_ctrl ,
5908.Ar esc_msb , utf8 , dump_nostr , dump_unknown ,
5909.Ar dump_der , sep_comma_plus , dn_rev ,
5910and
5911.Ar sname .
5912.It Ar sep_comma_plus , sep_comma_plus_space , sep_semi_plus_space , sep_multiline
5913These options determine the field separators.
5914The first character is between RDNs and the second between multiple AVAs
5915(multiple AVAs are very rare and their use is discouraged).
5916The options ending in
5917.Qq space
5918additionally place a space after the separator to make it more readable.
5919The
5920.Ar sep_multiline
5921uses a linefeed character for the RDN separator and a spaced
5922.Sq +
5923for the AVA separator.
5924It also indents the fields by four characters.
5925.It Ar show_type
5926Show the type of the ASN1 character string.
5927The type precedes the field contents.
5928For example
5929.Qq BMPSTRING: Hello World .
5930.It Ar space_eq
5931Places spaces round the
5932.Sq =
5933character which follows the field name.
5934.It Ar use_quote
5935Escapes some characters by surrounding the whole string with
5936.Sq \&"
5937characters.
5938Without the option, all escaping is done with the
5939.Sq \e
5940character.
5941.It Ar utf8
5942Convert all strings to UTF8 format first.
5943This is required by RFC 2253.
5944If you are lucky enough to have a UTF8 compatible terminal,
5945the use of this option (and
5946.Em not
5947setting
5948.Ar esc_msb )
5949may result in the correct display of multibyte
5950.Pq international
5951characters.
5952If this option is not present, multibyte characters larger than 0xff
5953will be represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX
5954for 32 bits.
5955Also, if this option is off, any UTF8Strings will be converted to their
5956character form first.
5957.El
5958.Sh X509 TEXT OPTIONS
5959As well as customising the name output format, it is also possible to
5960customise the actual fields printed using the
5961.Fl certopt
5962options when the
5963.Fl text
5964option is present.
5965The default behaviour is to print all fields.
5966.Bl -tag -width "XXXX"
5967.It Ar ca_default
5968The value used by the
5969.Nm ca
5970utility; equivalent to
5971.Ar no_issuer , no_pubkey , no_header ,
5972.Ar no_version , no_sigdump ,
5973and
5974.Ar no_signame .
5975.It Ar compatible
5976Use the old format.
5977This is equivalent to specifying no output options at all.
5978.It Ar ext_default
5979Retain default extension behaviour: attempt to print out unsupported
5980certificate extensions.
5981.It Ar ext_dump
5982Hex dump unsupported extensions.
5983.It Ar ext_error
5984Print an error message for unsupported certificate extensions.
5985.It Ar ext_parse
5986ASN1 parse unsupported extensions.
5987.It Ar no_aux
5988Don't print out certificate trust information.
5989.It Ar no_extensions
5990Don't print out any X509V3 extensions.
5991.It Ar no_header
5992Don't print header information: that is, the lines saying
5993.Qq Certificate
5994and
5995.Qq Data .
5996.It Ar no_issuer
5997Don't print out the issuer name.
5998.It Ar no_pubkey
5999Don't print out the public key.
6000.It Ar no_serial
6001Don't print out the serial number.
6002.It Ar no_sigdump
6003Don't give a hexadecimal dump of the certificate signature.
6004.It Ar no_signame
6005Don't print out the signature algorithm used.
6006.It Ar no_subject
6007Don't print out the subject name.
6008.It Ar no_validity
6009Don't print the validity; that is, the
6010.Em notBefore
6011and
6012.Em notAfter
6013fields.
6014.It Ar no_version
6015Don't print out the version number.
6016.El
6017.Sh X509 EXAMPLES
6018Display the contents of a certificate:
6019.Pp
6020.Dl $ openssl x509 -in cert.pem -noout -text
6021.Pp
6022Display the certificate serial number:
6023.Pp
6024.Dl $ openssl x509 -in cert.pem -noout -serial
6025.Pp
6026Display the certificate subject name:
6027.Pp
6028.Dl $ openssl x509 -in cert.pem -noout -subject
6029.Pp
6030Display the certificate subject name in RFC 2253 form:
6031.Pp
6032.Dl $ openssl x509 -in cert.pem -noout -subject -nameopt RFC2253
6033.Pp
6034Display the certificate subject name in oneline form on a terminal
6035supporting UTF8:
6036.Bd -literal -offset indent
6037$ openssl x509 -in cert.pem -noout -subject \e
6038 -nameopt oneline,-esc_msb
6039.Ed
6040.Pp
6041Display the certificate MD5 fingerprint:
6042.Pp
6043.Dl $ openssl x509 -in cert.pem -noout -fingerprint
6044.Pp
6045Display the certificate SHA1 fingerprint:
6046.Pp
6047.Dl $ openssl x509 -sha1 -in cert.pem -noout -fingerprint
6048.Pp
6049Convert a certificate from PEM to DER format:
6050.Pp
6051.Dl "$ openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER"
6052.Pp
6053Convert a certificate to a certificate request:
6054.Bd -literal -offset indent
6055$ openssl x509 -x509toreq -in cert.pem -out req.pem \e
6056 -signkey key.pem
6057.Ed
6058.Pp
6059Convert a certificate request into a self-signed certificate using
6060extensions for a CA:
6061.Bd -literal -offset indent
6062$ openssl x509 -req -in careq.pem -extfile openssl.cnf -extensions \e
6063 v3_ca -signkey key.pem -out cacert.pem
6064.Ed
6065.Pp
6066Sign a certificate request using the CA certificate above and add user
6067certificate extensions:
6068.Bd -literal -offset indent
6069$ openssl x509 -req -in req.pem -extfile openssl.cnf -extensions \e
6070 v3_usr -CA cacert.pem -CAkey key.pem -CAcreateserial
6071.Ed
6072.Pp
6073Set a certificate to be trusted for SSL
6074client use and set its alias to
6075.Qq Steve's Class 1 CA :
6076.Bd -literal -offset indent
6077$ openssl x509 -in cert.pem -addtrust clientAuth \e
6078 -setalias "Steve's Class 1 CA" -out trust.pem
6079.Ed
6080.Sh X509 NOTES
6081The PEM format uses the header and footer lines:
6082.Bd -unfilled -offset indent
6083-----BEGIN CERTIFICATE-----
6084-----END CERTIFICATE-----
6085.Ed
6086.Pp
6087It will also handle files containing:
6088.Bd -unfilled -offset indent
6089-----BEGIN X509 CERTIFICATE-----
6090-----END X509 CERTIFICATE-----
6091.Ed
6092.Pp
6093Trusted certificates have the lines:
6094.Bd -unfilled -offset indent
6095-----BEGIN TRUSTED CERTIFICATE-----
6096-----END TRUSTED CERTIFICATE-----
6097.Ed
6098.Pp
6099The conversion to UTF8 format used with the name options assumes that
6100T61Strings use the ISO 8859-1 character set.
6101This is wrong, but Netscape and MSIE do this, as do many certificates.
6102So although this is incorrect
6103it is more likely to display the majority of certificates correctly.
6104.Pp
6105The
6106.Fl fingerprint
6107option takes the digest of the DER-encoded certificate.
6108This is commonly called a
6109.Qq fingerprint .
6110Because of the nature of message digests, the fingerprint of a certificate
6111is unique to that certificate and two certificates with the same fingerprint
6112can be considered to be the same.
6113.Pp
6114The Netscape fingerprint uses MD5, whereas MSIE uses SHA1.
6115.Pp
6116The
6117.Fl email
6118option searches the subject name and the subject alternative
6119name extension.
6120Only unique email addresses will be printed out: it will
6121not print the same address more than once.
6122.Sh X.509 CERTIFICATE EXTENSIONS
6123The
6124.Fl purpose
6125option checks the certificate extensions and determines
6126what the certificate can be used for.
6127The actual checks done are rather
6128complex and include various hacks and workarounds to handle broken
6129certificates and software.
6130.Pp
6131The same code is used when verifying untrusted certificates in chains,
6132so this section is useful if a chain is rejected by the verify code.
6133.Pp
6134The
6135.Em basicConstraints
6136extension CA flag is used to determine whether the
6137certificate can be used as a CA.
6138If the CA flag is true, it is a CA;
6139if the CA flag is false, it is not a CA.
6140.Em All
6141CAs should have the CA flag set to true.
6142.Pp
6143If the
6144.Em basicConstraints
6145extension is absent, then the certificate is
6146considered to be a
6147.Qq possible CA ;
6148other extensions are checked according to the intended use of the certificate.
6149A warning is given in this case because the certificate should really not
6150be regarded as a CA: however,
6151it is allowed to be a CA to work around some broken software.
6152.Pp
6153If the certificate is a V1 certificate
6154.Pq and thus has no extensions
6155and it is self-signed, it is also assumed to be a CA but a warning is again
6156given: this is to work around the problem of Verisign roots which are V1
6157self-signed certificates.
6158.Pp
6159If the
6160.Em keyUsage
6161extension is present, then additional restraints are
6162made on the uses of the certificate.
6163A CA certificate
6164.Em must
6165have the
6166.Em keyCertSign
6167bit set if the
6168.Em keyUsage
6169extension is present.
6170.Pp
6171The extended key usage extension places additional restrictions on the
6172certificate uses.
6173If this extension is present
6174.Pq whether critical or not ,
6175the key can only be used for the purposes specified.
6176.Pp
6177A complete description of each test is given below.
6178The comments about
6179.Em basicConstraints
6180and
6181.Em keyUsage
6182and V1 certificates above apply to
6183.Em all
6184CA certificates.
6185.Bl -tag -width "XXXX"
6186.It Ar SSL Client
6187The extended key usage extension must be absent or include the
6188.Qq web client authentication
6189OID.
6190.Ar keyUsage
6191must be absent or it must have the
6192.Em digitalSignature
6193bit set.
6194Netscape certificate type must be absent or it must have the SSL
6195client bit set.
6196.It Ar SSL Client CA
6197The extended key usage extension must be absent or include the
6198.Qq web client authentication
6199OID.
6200Netscape certificate type must be absent or it must have the SSL CA
6201bit set: this is used as a work around if the
6202.Em basicConstraints
6203extension is absent.
6204.It Ar SSL Server
6205The extended key usage extension must be absent or include the
6206.Qq web server authentication
6207and/or one of the SGC OIDs.
6208.Em keyUsage
6209must be absent or it must have the
6210.Em digitalSignature
6211set, the
6212.Em keyEncipherment
6213set, or both bits set.
6214Netscape certificate type must be absent or have the SSL server bit set.
6215.It Ar SSL Server CA
6216The extended key usage extension must be absent or include the
6217.Qq web server authentication
6218and/or one of the SGC OIDs.
6219Netscape certificate type must be absent or the SSL CA
6220bit must be set: this is used as a work around if the
6221.Em basicConstraints
6222extension is absent.
6223.It Ar Netscape SSL Server
6224For Netscape SSL clients to connect to an SSL server; it must have the
6225.Em keyEncipherment
6226bit set if the
6227.Em keyUsage
6228extension is present.
6229This isn't always valid because some cipher suites use the key for
6230digital signing.
6231Otherwise it is the same as a normal SSL server.
6232.It Ar Common S/MIME Client Tests
6233The extended key usage extension must be absent or include the
6234.Qq email protection
6235OID.
6236Netscape certificate type must be absent or should have the
6237.Em S/MIME
6238bit set.
6239If the
6240.Em S/MIME
6241bit is not set in Netscape certificate type, then the SSL
6242client bit is tolerated as an alternative but a warning is shown:
6243this is because some Verisign certificates don't set the
6244.Em S/MIME
6245bit.
6246.It Ar S/MIME Signing
6247In addition to the common
6248.Em S/MIME
6249client tests, the
6250.Em digitalSignature
6251bit must be set if the
6252.Em keyUsage
6253extension is present.
6254.It Ar S/MIME Encryption
6255In addition to the common
6256.Em S/MIME
6257tests, the
6258.Em keyEncipherment
6259bit must be set if the
6260.Em keyUsage
6261extension is present.
6262.It Ar S/MIME CA
6263The extended key usage extension must be absent or include the
6264.Qq email protection
6265OID.
6266Netscape certificate type must be absent or must have the
6267.Em S/MIME CA
6268bit set: this is used as a work around if the
6269.Em basicConstraints
6270extension is absent.
6271.It Ar CRL Signing
6272The
6273.Em keyUsage
6274extension must be absent or it must have the
6275.Em CRL
6276signing bit set.
6277.It Ar CRL Signing CA
6278The normal CA tests apply.
6279Except in this case the
6280.Em basicConstraints
6281extension must be present.
6282.El
6283.Sh X509 BUGS
6284Extensions in certificates are not transferred to certificate requests and
6285vice versa.
6286.Pp
6287It is possible to produce invalid certificates or requests by specifying the
6288wrong private key or using inconsistent options in some cases: these should
6289be checked.
6290.Pp
6291There should be options to explicitly set such things as start and end dates,
6292rather than an offset from the current time.
6293.Pp
6294The code to implement the verify behaviour described in the
6295.Sx X509 TRUST SETTINGS
6296is currently being developed.
6297It thus describes the intended behaviour rather than the current behaviour.
6298It is hoped that it will represent reality in
6299.Nm OpenSSL
63000.9.5 and later.
6301.Sh X509 HISTORY
6302Before
6303.Nm OpenSSL
63040.9.8,
6305the default digest for RSA keys was MD5.
6306.Pp
6307The hash algorithm used in the
6308.Fl subject_hash
6309and
6310.Fl issuer_hash
6311options before
6312.Nm OpenSSL
63131.0.0 was based on the deprecated MD5 algorithm and the encoding
6314of the distinguished name.
6315In
6316.Nm OpenSSL
63171.0.0 and later it is based on a canonical version of the DN using SHA1.
6318This means that any directories using the old form
6319must have their links rebuilt using
6320.Ar c_rehash
6321or similar.
6322.Sh COMMON NOTATION 5981.Sh COMMON NOTATION
6323Several commands share a common syntax, 5982Several commands share a common syntax,
6324as detailed below. 5983as detailed below.