summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmc <>2004-12-03 01:41:17 +0000
committerjmc <>2004-12-03 01:41:17 +0000
commitd215df80389dbae81d8b3a3e210e6a1be96479ca (patch)
tree1a02ab47c451087324e0ac593b990048dbb6b345
parent0763d6b5127f254e776c4d39ecbeca9d455f1399 (diff)
downloadopenbsd-d215df80389dbae81d8b3a3e210e6a1be96479ca.tar.gz
openbsd-d215df80389dbae81d8b3a3e210e6a1be96479ca.tar.bz2
openbsd-d215df80389dbae81d8b3a3e210e6a1be96479ca.zip
various fixes for openssl x509;
-rw-r--r--src/usr.sbin/openssl/openssl.1685
1 files changed, 349 insertions, 336 deletions
diff --git a/src/usr.sbin/openssl/openssl.1 b/src/usr.sbin/openssl/openssl.1
index 0d76a4d158..cd76d416ab 100644
--- a/src/usr.sbin/openssl/openssl.1
+++ b/src/usr.sbin/openssl/openssl.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: openssl.1,v 1.49 2004/09/28 21:16:12 jmc Exp $ 1.\" $OpenBSD: openssl.1,v 1.50 2004/12/03 01:41:17 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.\"
@@ -7337,53 +7337,54 @@ option was added in
7337.Sh X509 7337.Sh X509
7338.Nm openssl x509 7338.Nm openssl x509
7339.Bk -words 7339.Bk -words
7340.Op Fl inform Ar DER | NET | PEM 7340.Op Fl alias
7341.Op Fl outform Ar DER | NET | PEM 7341.Op Fl C
7342.Op Fl keyform Ar DER | PEM 7342.Op Fl CAcreateserial
7343.Op Fl CAform Ar DER | PEM 7343.Op Fl clrext
7344.Op Fl CAkeyform Ar DER | PEM 7344.Op Fl clrreject
7345.Op Fl in Ar file 7345.Op Fl clrtrust
7346.Op Fl out Ar file 7346.Op Fl dates
7347.Op Fl passin Ar arg
7348.Op Fl serial
7349.Op Fl hash
7350.Op Fl subject
7351.Op Fl issuer
7352.Op Fl nameopt Ar option
7353.Op Fl email 7347.Op Fl email
7354.Op Fl startdate
7355.Op Fl enddate 7348.Op Fl enddate
7356.Op Fl purpose
7357.Op Fl dates
7358.Op Fl modulus
7359.Op Fl pubkey
7360.Op Fl fingerprint 7349.Op Fl fingerprint
7361.Op Fl alias 7350.Op Fl hash
7351.Op Fl issuer
7352.Op Fl md2 | md5 | sha1
7353.Op Fl modulus
7362.Op Fl noout 7354.Op Fl noout
7363.Op Fl ocspid 7355.Op Fl ocspid
7356.Op Fl pubkey
7357.Op Fl purpose
7358.Op Fl req
7359.Op Fl serial
7360.Op Fl startdate
7361.Op Fl subject
7362.Op Fl text
7364.Op Fl trustout 7363.Op Fl trustout
7365.Op Fl clrtrust
7366.Op Fl clrreject
7367.Op Fl addtrust Ar arg
7368.Op Fl addreject Ar arg
7369.Op Fl setalias Ar arg
7370.Op Fl days Ar arg
7371.Op Fl checkend Ar arg
7372.Op Fl set_serial Ar n
7373.Op Fl signkey Ar file
7374.Op Fl x509toreq 7364.Op Fl x509toreq
7375.Op Fl req 7365.Op Fl addreject Ar arg
7366.Op Fl addtrust Ar arg
7376.Op Fl CA Ar file 7367.Op Fl CA Ar file
7368.Op Fl CAform Ar DER | PEM
7377.Op Fl CAkey Ar file 7369.Op Fl CAkey Ar file
7378.Op Fl CAcreateserial 7370.Op Fl CAkeyform Ar DER | PEM
7379.Op Fl CAserial Ar file 7371.Op Fl CAserial Ar file
7380.Op Fl text 7372.Op Fl certopt Ar option
7381.Op Fl C 7373.Op Fl checkend Ar arg
7382.Op Fl md2 | md5 | sha1 7374.Op Fl days Ar arg
7383.Op Fl clrext
7384.Op Fl extfile Ar file
7385.Op Fl extensions Ar section
7386.Op Fl engine Ar id 7375.Op Fl engine Ar id
7376.Op Fl extensions Ar section
7377.Op Fl extfile Ar file
7378.Op Fl in Ar file
7379.Op Fl inform Ar DER | NET | PEM
7380.Op Fl keyform Ar DER | PEM
7381.Op Fl nameopt Ar option
7382.Op Fl out Ar file
7383.Op Fl outform Ar DER | NET | PEM
7384.Op Fl passin Ar arg
7385.Op Fl set_serial Ar n
7386.Op Fl setalias Ar arg
7387.Op Fl signkey Ar file
7387.Ek 7388.Ek
7388.Pp 7389.Pp
7389The 7390The
@@ -7398,6 +7399,18 @@ Since there are a large number of options, they are split up into
7398various sections. 7399various sections.
7399.Sh X509 INPUT, OUTPUT, AND GENERAL PURPOSE OPTIONS 7400.Sh X509 INPUT, OUTPUT, AND GENERAL PURPOSE OPTIONS
7400.Bl -tag -width "XXXX" 7401.Bl -tag -width "XXXX"
7402.It Fl engine Ar id
7403Specifying an engine (by it's unique
7404.Ar id
7405string) will cause
7406.Nm x509
7407to attempt to obtain a functional reference to the specified engine,
7408thus initialising it if needed.
7409The engine will then be set as the default for all available algorithms.
7410.It Fl in Ar file
7411This specifies the input
7412.Ar file
7413to read a certificate from, or standard input if this option is not specified.
7401.It Fl inform Ar DER | NET | PEM 7414.It Fl inform Ar DER | NET | PEM
7402This specifies the input format. 7415This specifies the input format.
7403Normally, the command will expect an X509 certificate, 7416Normally, the command will expect an X509 certificate,
@@ -7413,25 +7426,6 @@ The
7413.Ar NET 7426.Ar NET
7414option is an obscure Netscape server format that is now 7427option is an obscure Netscape server format that is now
7415obsolete. 7428obsolete.
7416.It Fl outform Ar DER | NET | PEM
7417This specifies the output format; the options have the same meaning as the
7418.Fl inform
7419option.
7420.It Fl in Ar file
7421This specifies the input
7422.Ar file
7423to read a certificate from, or standard input if this option is not specified.
7424.It Fl out Ar file
7425This specifies the output
7426.Ar file
7427to write to, or standard output by default.
7428.It Fl passin Ar arg
7429The key password source.
7430For more information about the format of
7431.Ar arg ,
7432see the
7433.Sx PASS PHRASE ARGUMENTS
7434section above.
7435.It Fl md2 | md5 | sha1 7429.It Fl md2 | md5 | sha1
7436The digest to use. 7430The digest to use.
7437This affects any signing or display option that uses a message digest, 7431This affects any signing or display option that uses a message digest,
@@ -7443,14 +7437,21 @@ options.
7443If not specified, MD5 is used. 7437If not specified, MD5 is used.
7444If the key being used to sign with is a DSA key, 7438If the key being used to sign with is a DSA key,
7445this option has no effect: SHA1 is always used with DSA keys. 7439this option has no effect: SHA1 is always used with DSA keys.
7446.It Fl engine Ar id 7440.It Fl out Ar file
7447Specifying an engine (by it's unique 7441This specifies the output
7448.Ar id 7442.Ar file
7449string) will cause 7443to write to, or standard output by default.
7450.Nm x509 7444.It Fl outform Ar DER | NET | PEM
7451to attempt to obtain a functional reference to the specified engine, 7445This specifies the output format; the options have the same meaning as the
7452thus initialising it if needed. 7446.Fl inform
7453The engine will then be set as the default for all available algorithms. 7447option.
7448.It Fl passin Ar arg
7449The key password source.
7450For more information about the format of
7451.Ar arg ,
7452see the
7453.Sx PASS PHRASE ARGUMENTS
7454section above.
7454.El 7455.El
7455.Sh X509 DISPLAY OPTIONS 7456.Sh X509 DISPLAY OPTIONS
7456.Sy Note : 7457.Sy Note :
@@ -7462,11 +7463,8 @@ options are also display options but are described in the
7462.Sx X509 TRUST SETTINGS 7463.Sx X509 TRUST SETTINGS
7463section. 7464section.
7464.Bl -tag -width "XXXX" 7465.Bl -tag -width "XXXX"
7465.It Fl text 7466.It Fl C
7466Prints out the certificate in text form. 7467This outputs the certificate in the form of a C source file.
7467Full details are output including the public key, signature algorithms,
7468issuer and subject names, serial number, any extensions present and any
7469trust settings.
7470.It Fl certopt Ar option 7468.It Fl certopt Ar option
7471Customise the output format used with 7469Customise the output format used with
7472.Fl text . 7470.Fl text .
@@ -7479,17 +7477,18 @@ switch may also be used more than once to set multiple options.
7479See the 7477See the
7480.Sx X509 TEXT OPTIONS 7478.Sx X509 TEXT OPTIONS
7481section for more information. 7479section for more information.
7482.It Fl noout 7480.It Fl dates
7483This option prevents output of the encoded version of the request. 7481Prints out the start and expiry dates of a certificate.
7484.It Fl ocspid 7482.It Fl email
7485Print OCSP hash values for the subject name and public key. 7483Outputs the email address(es), if any.
7486.It Fl modulus 7484.It Fl enddate
7487This option prints out the value of the modulus of the public key 7485Prints out the expiry date of the certificate; that is, the
7488contained in the certificate. 7486.Em notAfter
7489.It Fl pubkey 7487date.
7490Output the public key. 7488.It Fl fingerprint
7491.It Fl serial 7489Prints out the digest of the DER-encoded version of the whole certificate
7492Outputs the certificate serial number. 7490(see
7491.Sx DIGEST OPTIONS ) .
7493.It Fl hash 7492.It Fl hash
7494Outputs the 7493Outputs the
7495.Qq hash 7494.Qq hash
@@ -7498,10 +7497,11 @@ This is used in
7498.Nm OpenSSL 7497.Nm OpenSSL
7499to form an index to allow certificates in a directory to be looked up 7498to form an index to allow certificates in a directory to be looked up
7500by subject name. 7499by subject name.
7501.It Fl subject
7502Outputs the subject name.
7503.It Fl issuer 7500.It Fl issuer
7504Outputs the issuer name. 7501Outputs the issuer name.
7502.It Fl modulus
7503This option prints out the value of the modulus of the public key
7504contained in the certificate.
7505.It Fl nameopt Ar option 7505.It Fl nameopt Ar option
7506Option which determines how the subject or issuer names are displayed. 7506Option which determines how the subject or issuer names are displayed.
7507The 7507The
@@ -7513,24 +7513,25 @@ switch may be used more than once to set multiple options.
7513See the 7513See the
7514.Sx X509 NAME OPTIONS 7514.Sx X509 NAME OPTIONS
7515section for more information. 7515section for more information.
7516.It Fl email 7516.It Fl noout
7517Outputs the email address(es) if any. 7517This option prevents output of the encoded version of the request.
7518.It Fl ocspid
7519Print OCSP hash values for the subject name and public key.
7520.It Fl pubkey
7521Output the public key.
7522.It Fl serial
7523Outputs the certificate serial number.
7518.It Fl startdate 7524.It Fl startdate
7519Prints out the start date of the certificate; that is, the 7525Prints out the start date of the certificate; that is, the
7520.Em notBefore 7526.Em notBefore
7521date. 7527date.
7522.It Fl enddate 7528.It Fl subject
7523Prints out the expiry date of the certificate; that is, the 7529Outputs the subject name.
7524.Em notAfter 7530.It Fl text
7525date. 7531Prints out the certificate in text form.
7526.It Fl dates 7532Full details are output including the public key, signature algorithms,
7527Prints out the start and expiry dates of a certificate. 7533issuer and subject names, serial number, any extensions present,
7528.It Fl fingerprint 7534and any trust settings.
7529Prints out the digest of the DER-encoded version of the whole certificate
7530(see
7531.Sx DIGEST OPTIONS ) .
7532.It Fl C
7533This outputs the certificate in the form of a C source file.
7534.El 7535.El
7535.Sh X509 TRUST SETTINGS 7536.Sh X509 TRUST SETTINGS
7536Please note these options are currently experimental and may well change. 7537Please note these options are currently experimental and may well change.
@@ -7562,29 +7563,11 @@ Future versions of
7562.Nm OpenSSL 7563.Nm OpenSSL
7563will recognize trust settings on any certificate: not just root CAs. 7564will recognize trust settings on any certificate: not just root CAs.
7564.Bl -tag -width "XXXX" 7565.Bl -tag -width "XXXX"
7565.It Fl trustout 7566.It Fl addreject Ar arg
7566This causes 7567Adds a prohibited use.
7567.Nm x509 7568It accepts the same values as the
7568to output a 7569.Fl addtrust
7569.Em trusted certificate . 7570option.
7570An ordinary or trusted certificate can be input, but by default an ordinary
7571certificate is output and any trust settings are discarded.
7572With the
7573.Fl trustout
7574option a trusted certificate is output.
7575A trusted certificate is automatically output if any trust settings
7576are modified.
7577.It Fl setalias Ar arg
7578Sets the alias of the certificate.
7579This will allow the certificate to be referred to using a nickname,
7580for example
7581.Qq Steve's Certificate .
7582.It Fl alias
7583Outputs the certificate alias, if any.
7584.It Fl clrtrust
7585Clears all the permitted or trusted uses of the certificate.
7586.It Fl clrreject
7587Clears all the prohibited or rejected uses of the certificate.
7588.It Fl addtrust Ar arg 7571.It Fl addtrust Ar arg
7589Adds a trusted certificate use. 7572Adds a trusted certificate use.
7590Any object name can be used here, but currently only 7573Any object name can be used here, but currently only
@@ -7599,17 +7582,35 @@ are used.
7599Other 7582Other
7600.Nm OpenSSL 7583.Nm OpenSSL
7601applications may define additional uses. 7584applications may define additional uses.
7602.It Fl addreject Ar arg 7585.It Fl alias
7603Adds a prohibited use. 7586Outputs the certificate alias, if any.
7604It accepts the same values as the 7587.It Fl clrreject
7605.Fl addtrust 7588Clears all the prohibited or rejected uses of the certificate.
7606option. 7589.It Fl clrtrust
7590Clears all the permitted or trusted uses of the certificate.
7607.It Fl purpose 7591.It Fl purpose
7608This option performs tests on the certificate extensions and outputs 7592This option performs tests on the certificate extensions and outputs
7609the results. 7593the results.
7610For a more complete description, see the 7594For a more complete description, see the
7611.Sx X509 CERTIFICATE EXTENSIONS 7595.Sx X509 CERTIFICATE EXTENSIONS
7612section. 7596section.
7597.It Fl setalias Ar arg
7598Sets the alias of the certificate.
7599This will allow the certificate to be referred to using a nickname,
7600for example
7601.Qq Steve's Certificate .
7602.It Fl trustout
7603This causes
7604.Nm x509
7605to output a
7606.Em trusted certificate .
7607An ordinary or trusted certificate can be input, but by default an ordinary
7608certificate is output and any trust settings are discarded.
7609With the
7610.Fl trustout
7611option a trusted certificate is output.
7612A trusted certificate is automatically output if any trust settings
7613are modified.
7613.El 7614.El
7614.Sh X509 SIGNING OPTIONS 7615.Sh X509 SIGNING OPTIONS
7615The 7616The
@@ -7618,76 +7619,6 @@ utility can be used to sign certificates and requests: it
7618can thus behave like a 7619can thus behave like a
7619.Qq mini CA . 7620.Qq mini CA .
7620.Bl -tag -width "XXXX" 7621.Bl -tag -width "XXXX"
7621.It Fl signkey Ar file
7622This option causes the input file to be self-signed using the supplied
7623private key.
7624.Pp
7625If the input file is a certificate, it sets the issuer name to the
7626subject name
7627.Pq i.e. makes it self-signed ,
7628changes the public key to the supplied value
7629and changes the start and end dates.
7630The start date is set to the current time and the end date is set to
7631a value determined by the
7632.Fl days
7633option.
7634Any certificate extensions are retained unless the
7635.Fl clrext
7636option is supplied.
7637.Pp
7638If the input is a certificate request, a self-signed certificate
7639is created using the supplied private key using the subject name in
7640the request.
7641.It Fl clrext
7642Delete any extensions from a certificate.
7643This option is used when a certificate is being created from another
7644certificate (for example with the
7645.Fl signkey
7646or the
7647.Fl CA
7648options).
7649Normally, all extensions are retained.
7650.It Fl keyform Ar DER | PEM
7651Specifies the format
7652.Pq DER or PEM
7653of the private key file used in the
7654.Fl signkey
7655option.
7656.It Fl days Ar arg
7657Specifies the number of days to make a certificate valid for.
7658The default is 30 days.
7659.It Fl checkend Ar arg
7660Check whether the certificate expires in the next
7661.Ar arg
7662seconds.
7663If so, exit with return value 1;
7664otherwise exit with return value 0.
7665.It Fl x509toreq
7666Converts a certificate into a certificate request.
7667The
7668.Fl signkey
7669option is used to pass the required private key.
7670.It Fl req
7671By default, a certificate is expected on input.
7672With this option a certificate request is expected instead.
7673.It Fl set_serial Ar n
7674Specifies the serial number to use.
7675This option can be used with either the
7676.Fl signkey
7677or
7678.Fl CA
7679options.
7680If used in conjunction with the
7681.Fl CA
7682option, the serial number file (as specified by the
7683.Fl CAserial
7684or
7685.Fl CAcreateserial
7686options) is not used.
7687.Pp
7688The serial number can be decimal or hex (if preceded by
7689.Sq 0x ) .
7690Negative serial numbers can also be specified but their use is not recommended.
7691.It Fl CA Ar file 7622.It Fl CA Ar file
7692Specifies the CA certificate to be used for signing. 7623Specifies the CA certificate to be used for signing.
7693When this option is present, 7624When this option is present,
@@ -7704,18 +7635,36 @@ option.
7704Without the 7635Without the
7705.Fl req 7636.Fl req
7706option, the input is a certificate which must be self-signed. 7637option, the input is a certificate which must be self-signed.
7638.It Fl CAcreateserial
7639With this option the CA serial number file is created if it does not exist:
7640it will contain the serial number
7641.Sq 02
7642and the certificate being signed will have
7643.Sq 1
7644as its serial number.
7645Normally, if the
7646.Fl CA
7647option is specified and the serial number file does not exist, it is an error.
7648.It Fl CAform Ar DER | PEM
7649The format of the CA certificate file.
7650The default is
7651.Ar PEM .
7707.It Fl CAkey Ar file 7652.It Fl CAkey Ar file
7708Sets the CA private key to sign a certificate with. 7653Sets the CA private key to sign a certificate with.
7709If this option is not specified, it is assumed that the CA private key 7654If this option is not specified, it is assumed that the CA private key
7710is present in the CA certificate file. 7655is present in the CA certificate file.
7656.It Fl CAkeyform Ar DER | PEM
7657The format of the CA private key.
7658The default is
7659.Ar PEM .
7711.It Fl CAserial Ar file 7660.It Fl CAserial Ar file
7712Sets the CA serial number file to use. 7661Sets the CA serial number file to use.
7713.Pp 7662.Pp
7714When the 7663When the
7715.Fl CA 7664.Fl CA
7716option is used to sign a certificate it uses a serial 7665option is used to sign a certificate,
7717number specified in a file. 7666it uses a serial number specified in a file.
7718This file consist of one line containing an even number of hex digits 7667This file consists of one line containing an even number of hex digits
7719with the serial number to use. 7668with the serial number to use.
7720After each use the serial number is incremented and written out 7669After each use the serial number is incremented and written out
7721to the file again. 7670to the file again.
@@ -7727,19 +7676,24 @@ For example, if the CA certificate file is called
7727.Pa mycacert.pem , 7676.Pa mycacert.pem ,
7728it expects to find a serial number file called 7677it expects to find a serial number file called
7729.Pa mycacert.srl . 7678.Pa mycacert.srl .
7730.It Fl CAcreateserial 7679.It Fl checkend Ar arg
7731With this option the CA serial number file is created if it does not exist: 7680Check whether the certificate expires in the next
7732it will contain the serial number 7681.Ar arg
7733.Sq 02 7682seconds.
7734and the certificate being signed will have 7683If so, exit with return value 1;
7735.Sq 1 7684otherwise exit with return value 0.
7736as its serial number. 7685.It Fl clrext
7737Normally, if the 7686Delete any extensions from a certificate.
7687This option is used when a certificate is being created from another
7688certificate (for example with the
7689.Fl signkey
7690or the
7738.Fl CA 7691.Fl CA
7739option is specified and the serial number file does not exist, it is an error. 7692options).
7740.It Fl extfile Ar file 7693Normally, all extensions are retained.
7741File containing certificate extensions to use. 7694.It Fl days Ar arg
7742If not specified, no extensions are added to the certificate. 7695Specifies the number of days to make a certificate valid for.
7696The default is 30 days.
7743.It Fl extensions Ar section 7697.It Fl extensions Ar section
7744The section to add certificate extensions from. 7698The section to add certificate extensions from.
7745If this option is not specified, the extensions should either be 7699If this option is not specified, the extensions should either be
@@ -7748,6 +7702,61 @@ contained in the unnamed
7748section or the default section should contain a variable called 7702section or the default section should contain a variable called
7749.Qq extensions 7703.Qq extensions
7750which contains the section to use. 7704which contains the section to use.
7705.It Fl extfile Ar file
7706File containing certificate extensions to use.
7707If not specified, no extensions are added to the certificate.
7708.It Fl keyform Ar DER | PEM
7709Specifies the format
7710.Pq DER or PEM
7711of the private key file used in the
7712.Fl signkey
7713option.
7714.It Fl req
7715By default, a certificate is expected on input.
7716With this option a certificate request is expected instead.
7717.It Fl set_serial Ar n
7718Specifies the serial number to use.
7719This option can be used with either the
7720.Fl signkey
7721or
7722.Fl CA
7723options.
7724If used in conjunction with the
7725.Fl CA
7726option, the serial number file (as specified by the
7727.Fl CAserial
7728or
7729.Fl CAcreateserial
7730options) is not used.
7731.Pp
7732The serial number can be decimal or hex (if preceded by
7733.Sq 0x ) .
7734Negative serial numbers can also be specified but their use is not recommended.
7735.It Fl signkey Ar file
7736This option causes the input file to be self-signed using the supplied
7737private key.
7738.Pp
7739If the input file is a certificate, it sets the issuer name to the
7740subject name
7741.Pq i.e. makes it self-signed ,
7742changes the public key to the supplied value,
7743and changes the start and end dates.
7744The start date is set to the current time and the end date is set to
7745a value determined by the
7746.Fl days
7747option.
7748Any certificate extensions are retained unless the
7749.Fl clrext
7750option is supplied.
7751.Pp
7752If the input is a certificate request, a self-signed certificate
7753is created using the supplied private key using the subject name in
7754the request.
7755.It Fl x509toreq
7756Converts a certificate into a certificate request.
7757The
7758.Fl signkey
7759option is used to pass the required private key.
7751.El 7760.El
7752.Sh X509 NAME OPTIONS 7761.Sh X509 NAME OPTIONS
7753The 7762The
@@ -7763,32 +7772,44 @@ format is used which is compatible with previous versions of
7763Each option is described in detail below; all options can be preceded by a 7772Each option is described in detail below; all options can be preceded by a
7764.Sq - 7773.Sq -
7765to turn the option off. 7774to turn the option off.
7766Only the first four will normally be used. 7775Only
7776.Ar compat ,
7777.Ar RFC2253 ,
7778.Ar oneline ,
7779and
7780.Ar multiline
7781will normally be used.
7767.Bl -tag -width "XXXX" 7782.Bl -tag -width "XXXX"
7783.It Ar align
7784Align field values for a more readable output.
7785Only usable with
7786.Ar sep_multiline .
7768.It Ar compat 7787.It Ar compat
7769Use the old format. 7788Use the old format.
7770This is equivalent to specifying no name options at all. 7789This is equivalent to specifying no name options at all.
7771.It Ar RFC2253 7790.It Ar dn_rev
7772Displays names compatible with RFC 2253; equivalent to 7791Reverse the fields of the DN.
7773.Ar esc_2253 , esc_ctrl , 7792This is required by RFC 2253.
7774.Ar esc_msb , utf8 , dump_nostr , dump_unknown , 7793As a side effect, this also reverses the order of multiple AVAs but this is
7775.Ar dump_der , sep_comma_plus , dn_rev and sname . 7794permissible.
7776.It Ar oneline 7795.It Ar dump_all
7777A oneline format which is more readable than RFC2253. 7796Dump all fields.
7778It is equivalent to specifying the 7797This option, when used with
7779.Ar esc_2253 , esc_ctrl , esc_msb , utf8 , 7798.Ar dump_der ,
7780.Ar dump_nostr , dump_der , use_quote , sep_comma_plus_spc , 7799allows the DER encoding of the structure to be unambiguously determined.
7781.Ar spc_eq 7800.It Ar dump_der
7782and 7801When this option is set, any fields that need to be hexdumped will
7783.Ar sname 7802be dumped using the DER encoding of the field.
7784options. 7803Otherwise just the content octets will be displayed.
7785.It Ar multiline 7804Both options use the RFC 2253 #XXXX... format.
7786A multiline format. 7805.It Ar dump_nostr
7787It is equivalent to 7806Dump non-character string types
7788.Ar esc_ctrl , esc_msb , sep_multiline , 7807.Pq for example OCTET STRING ;
7789.Ar spc_eq , lname 7808if this option is not set, non-character string types will be displayed
7790and 7809as though each content octet represents a single character.
7791.Ar align . 7810.It Ar dump_unknown
7811Dump any field whose OID is not recognised by
7812.Nm OpenSSL .
7792.It Ar esc_2253 7813.It Ar esc_2253
7793Escape the 7814Escape the
7794.Qq special 7815.Qq special
@@ -7810,29 +7831,13 @@ digits representing the character value).
7810.It Ar esc_msb 7831.It Ar esc_msb
7811Escape characters with the MSB set; that is, with ASCII values larger than 7832Escape characters with the MSB set; that is, with ASCII values larger than
7812127. 7833127.
7813.It Ar use_quote 7834.It Ar multiline
7814Escapes some characters by surrounding the whole string with 7835A multiline format.
7815.Sq \&" 7836It is equivalent to
7816characters. 7837.Ar esc_ctrl , esc_msb , sep_multiline ,
7817Without the option, all escaping is done with the 7838.Ar spc_eq , lname ,
7818.Sq \e 7839and
7819character. 7840.Ar align .
7820.It Ar utf8
7821Convert all strings to UTF8 format first.
7822This is required by RFC 2253.
7823If you are lucky enough to have a UTF8 compatible terminal,
7824the use of this option (and
7825.Em not
7826setting
7827.Ar esc_msb )
7828may result in the correct display of multibyte
7829.Pq international
7830characters.
7831If this option is not present, multibyte characters larger than 0xff
7832will be represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX
7833for 32 bits.
7834Also, if this option is off, any UTF8Strings will be converted to their
7835character form first.
7836.It Ar no_type 7841.It Ar no_type
7837This option does not attempt to interpret multibyte characters in any 7842This option does not attempt to interpret multibyte characters in any
7838way. 7843way.
@@ -7840,47 +7845,6 @@ That is, their content octets are merely dumped as though one octet
7840represents each character. 7845represents each character.
7841This is useful for diagnostic purposes but will result in rather odd 7846This is useful for diagnostic purposes but will result in rather odd
7842looking output. 7847looking output.
7843.It Ar show_type
7844Show the type of the ASN1 character string.
7845The type precedes the field contents.
7846For example
7847.Qq BMPSTRING: Hello World .
7848.It Ar dump_der
7849When this option is set, any fields that need to be hexdumped will
7850be dumped using the DER encoding of the field.
7851Otherwise just the content octets will be displayed.
7852Both options use the RFC 2253 #XXXX... format.
7853.It Ar dump_nostr
7854Dump non-character string types
7855.Pq for example OCTET STRING ;
7856if this option is not set, non-character string types will be displayed
7857as though each content octet represents a single character.
7858.It Ar dump_all
7859Dump all fields.
7860This option, when used with
7861.Ar dump_der ,
7862allows the DER encoding of the structure to be unambiguously determined.
7863.It Ar dump_unknown
7864Dump any field whose OID is not recognised by
7865.Nm OpenSSL .
7866.It Ar sep_comma_plus , sep_comma_plus_space , sep_semi_plus_space , sep_multiline
7867These options determine the field separators.
7868The first character is between RDNs and the second between multiple AVAs
7869(multiple AVAs are very rare and their use is discouraged).
7870The options ending in
7871.Qq space
7872additionally place a space after the separator to make it more readable.
7873The
7874.Ar sep_multiline
7875uses a linefeed character for the RDN separator and a spaced
7876.Sq +
7877for the AVA separator.
7878It also indents the fields by four characters.
7879.It Ar dn_rev
7880Reverse the fields of the DN.
7881This is required by RFC 2253.
7882As a side effect, this also reverses the order of multiple AVAs but this is
7883permissible.
7884.It Ar nofname , sname , lname , oid 7848.It Ar nofname , sname , lname , oid
7885These options alter how the field name is displayed. 7849These options alter how the field name is displayed.
7886.Ar nofname 7850.Ar nofname
@@ -7895,14 +7859,68 @@ for example).
7895uses the long form. 7859uses the long form.
7896.Ar oid 7860.Ar oid
7897represents the OID in numerical form and is useful for diagnostic purpose. 7861represents the OID in numerical form and is useful for diagnostic purpose.
7898.It Ar align 7862.It Ar oneline
7899Align field values for a more readable output. 7863A oneline format which is more readable than
7900Only usable with 7864.Ar RFC2253 .
7901.Ar sep_multiline . 7865It is equivalent to specifying the
7866.Ar esc_2253 , esc_ctrl , esc_msb , utf8 ,
7867.Ar dump_nostr , dump_der , use_quote , sep_comma_plus_spc ,
7868.Ar spc_eq ,
7869and
7870.Ar sname
7871options.
7872.It Ar RFC2253
7873Displays names compatible with RFC 2253; equivalent to
7874.Ar esc_2253 , esc_ctrl ,
7875.Ar esc_msb , utf8 , dump_nostr , dump_unknown ,
7876.Ar dump_der , sep_comma_plus , dn_rev ,
7877and
7878.Ar sname .
7879.It Ar sep_comma_plus , sep_comma_plus_space , sep_semi_plus_space , sep_multiline
7880These options determine the field separators.
7881The first character is between RDNs and the second between multiple AVAs
7882(multiple AVAs are very rare and their use is discouraged).
7883The options ending in
7884.Qq space
7885additionally place a space after the separator to make it more readable.
7886The
7887.Ar sep_multiline
7888uses a linefeed character for the RDN separator and a spaced
7889.Sq +
7890for the AVA separator.
7891It also indents the fields by four characters.
7892.It Ar show_type
7893Show the type of the ASN1 character string.
7894The type precedes the field contents.
7895For example
7896.Qq BMPSTRING: Hello World .
7902.It Ar spc_eq 7897.It Ar spc_eq
7903Places spaces round the 7898Places spaces round the
7904.Sq = 7899.Sq =
7905character which follows the field name. 7900character which follows the field name.
7901.It Ar use_quote
7902Escapes some characters by surrounding the whole string with
7903.Sq \&"
7904characters.
7905Without the option, all escaping is done with the
7906.Sq \e
7907character.
7908.It Ar utf8
7909Convert all strings to UTF8 format first.
7910This is required by RFC 2253.
7911If you are lucky enough to have a UTF8 compatible terminal,
7912the use of this option (and
7913.Em not
7914setting
7915.Ar esc_msb )
7916may result in the correct display of multibyte
7917.Pq international
7918characters.
7919If this option is not present, multibyte characters larger than 0xff
7920will be represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX
7921for 32 bits.
7922Also, if this option is off, any UTF8Strings will be converted to their
7923character form first.
7906.El 7924.El
7907.Sh X509 TEXT OPTIONS 7925.Sh X509 TEXT OPTIONS
7908As well as customising the name output format, it is also possible to 7926As well as customising the name output format, it is also possible to
@@ -7913,62 +7931,57 @@ options when the
7913option is present. 7931option is present.
7914The default behaviour is to print all fields. 7932The default behaviour is to print all fields.
7915.Bl -tag -width "XXXX" 7933.Bl -tag -width "XXXX"
7934.It Ar ca_default
7935The value used by the
7936.Nm ca
7937utility; equivalent to
7938.Ar no_issuer , no_pubkey , no_header ,
7939.Ar no_version , no_sigdump ,
7940and
7941.Ar no_signame .
7916.It Ar compatible 7942.It Ar compatible
7917Use the old format. 7943Use the old format.
7918This is equivalent to specifying no output options at all. 7944This is equivalent to specifying no output options at all.
7945.It Ar ext_default
7946Retain default extension behaviour: attempt to print out unsupported
7947certificate extensions.
7948.It Ar ext_dump
7949Hex dump unsupported extensions.
7950.It Ar ext_error
7951Print an error message for unsupported certificate extensions.
7952.It Ar ext_parse
7953ASN1 parse unsupported extensions.
7954.It Ar no_aux
7955Don't print out certificate trust information.
7956.It Ar no_extensions
7957Don't print out any X509V3 extensions.
7919.It Ar no_header 7958.It Ar no_header
7920Don't print header information: that is, the lines saying 7959Don't print header information: that is, the lines saying
7921.Qq Certificate 7960.Qq Certificate
7922and 7961and
7923.Qq Data . 7962.Qq Data .
7924.It Ar no_version 7963.It Ar no_issuer
7925Don't print out the version number. 7964Don't print out the issuer name.
7965.It Ar no_pubkey
7966Don't print out the public key.
7926.It Ar no_serial 7967.It Ar no_serial
7927Don't print out the serial number. 7968Don't print out the serial number.
7969.It Ar no_sigdump
7970Don't give a hexadecimal dump of the certificate signature.
7928.It Ar no_signame 7971.It Ar no_signame
7929Don't print out the signature algorithm used. 7972Don't print out the signature algorithm used.
7973.It Ar no_subject
7974Don't print out the subject name.
7930.It Ar no_validity 7975.It Ar no_validity
7931Don't print the validity; that is, the 7976Don't print the validity; that is, the
7932.Em notBefore 7977.Em notBefore
7933and 7978and
7934.Em notAfter 7979.Em notAfter
7935fields. 7980fields.
7936.It Ar no_subject 7981.It Ar no_version
7937Don't print out the subject name. 7982Don't print out the version number.
7938.It Ar no_issuer
7939Don't print out the issuer name.
7940.It Ar no_pubkey
7941Don't print out the public key.
7942.It Ar no_sigdump
7943Don't give a hexadecimal dump of the certificate signature.
7944.It Ar no_aux
7945Don't print out certificate trust information.
7946.It Ar no_extensions
7947Don't print out any X509V3 extensions.
7948.It Ar ext_default
7949Retain default extension behaviour: attempt to print out unsupported
7950certificate extensions.
7951.It Ar ext_error
7952Print an error message for unsupported certificate extensions.
7953.It Ar ext_parse
7954ASN1 parse unsupported extensions.
7955.It Ar ext_dump
7956Hex dump unsupported extensions.
7957.It Ar ca_default
7958The value used by the
7959.Nm ca
7960utility, equivalent to
7961.Ar no_issuer , no_pubkey , no_header ,
7962.Ar no_version , no_sigdump
7963and
7964.Ar no_signame .
7965.El 7983.El
7966.Sh X509 EXAMPLES 7984.Sh X509 EXAMPLES
7967.Sy Note :
7968In these examples the
7969.Sq \e
7970means the example should be all on one line.
7971.Pp
7972Display the contents of a certificate: 7985Display the contents of a certificate:
7973.Pp 7986.Pp
7974.Dl $ openssl x509 -in cert.pem -noout -text 7987.Dl $ openssl x509 -in cert.pem -noout -text
@@ -7989,7 +8002,7 @@ Display the certificate subject name in oneline form on a terminal
7989supporting UTF8: 8002supporting UTF8:
7990.Bd -literal -offset indent 8003.Bd -literal -offset indent
7991$ openssl x509 -in cert.pem -noout -subject \e 8004$ openssl x509 -in cert.pem -noout -subject \e
7992 -nameopt oneline,-escmsb 8005 -nameopt oneline,esc_msb
7993.Ed 8006.Ed
7994.Pp 8007.Pp
7995Display the certificate MD5 fingerprint: 8008Display the certificate MD5 fingerprint: