2001-04-09 16:29:33 +04:00
|
|
|
.\" Automatically generated by Pod::Man version 1.02
|
|
|
|
.\" Sun Apr 8 15:39:45 2001
|
|
|
|
.\"
|
|
|
|
.\" Standard preamble:
|
|
|
|
.\" ======================================================================
|
|
|
|
.de Sh \" Subsection heading
|
2000-10-04 09:41:25 +04:00
|
|
|
.br
|
|
|
|
.if t .Sp
|
|
|
|
.ne 5
|
|
|
|
.PP
|
|
|
|
\fB\\$1\fR
|
|
|
|
.PP
|
|
|
|
..
|
2001-04-09 16:29:33 +04:00
|
|
|
.de Sp \" Vertical space (when we can't use .PP)
|
2000-10-04 09:41:25 +04:00
|
|
|
.if t .sp .5v
|
|
|
|
.if n .sp
|
|
|
|
..
|
2001-04-09 16:29:33 +04:00
|
|
|
.de Ip \" List item
|
2000-10-04 09:41:25 +04:00
|
|
|
.br
|
|
|
|
.ie \\n(.$>=3 .ne \\$3
|
|
|
|
.el .ne 3
|
|
|
|
.IP "\\$1" \\$2
|
|
|
|
..
|
2001-04-09 16:29:33 +04:00
|
|
|
.de Vb \" Begin verbatim text
|
2000-10-04 09:41:25 +04:00
|
|
|
.ft CW
|
|
|
|
.nf
|
|
|
|
.ne \\$1
|
|
|
|
..
|
2001-04-09 16:29:33 +04:00
|
|
|
.de Ve \" End verbatim text
|
2000-10-04 09:41:25 +04:00
|
|
|
.ft R
|
|
|
|
|
|
|
|
.fi
|
|
|
|
..
|
2001-04-09 16:29:33 +04:00
|
|
|
.\" Set up some character translations and predefined strings. \*(-- will
|
|
|
|
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
|
|
|
.\" double quote, and \*(R" will give a right double quote. | will give a
|
|
|
|
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
|
|
|
|
.\" to do unbreakable dashes and therefore won't be available. \*(C` and
|
|
|
|
.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
|
2000-10-04 09:41:25 +04:00
|
|
|
.tr \(*W-|\(bv\*(Tr
|
2001-04-09 16:29:33 +04:00
|
|
|
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
2000-10-04 09:41:25 +04:00
|
|
|
.ie n \{\
|
2001-04-09 16:29:33 +04:00
|
|
|
. ds -- \(*W-
|
|
|
|
. ds PI pi
|
|
|
|
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
|
|
|
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
|
|
|
. ds L" ""
|
|
|
|
. ds R" ""
|
|
|
|
. ds C` `
|
|
|
|
. ds C' '
|
2000-10-04 09:41:25 +04:00
|
|
|
'br\}
|
|
|
|
.el\{\
|
2001-04-09 16:29:33 +04:00
|
|
|
. ds -- \|\(em\|
|
|
|
|
. ds PI \(*p
|
|
|
|
. ds L" ``
|
|
|
|
. ds R" ''
|
2000-10-04 09:41:25 +04:00
|
|
|
'br\}
|
2001-04-09 16:29:33 +04:00
|
|
|
.\"
|
|
|
|
.\" If the F register is turned on, we'll generate index entries on stderr
|
|
|
|
.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
|
|
|
|
.\" index entries marked with X<> in POD. Of course, you'll have to process
|
|
|
|
.\" the output yourself in some meaningful fashion.
|
|
|
|
.if \nF \{\
|
|
|
|
. de IX
|
|
|
|
. tm Index:\\$1\t\\n%\t"\\$2"
|
|
|
|
. .
|
|
|
|
. nr % 0
|
|
|
|
. rr F
|
2000-10-04 09:41:25 +04:00
|
|
|
.\}
|
2001-04-09 16:29:33 +04:00
|
|
|
.\"
|
|
|
|
.\" For nroff, turn off justification. Always turn off hyphenation; it
|
|
|
|
.\" makes way too many mistakes in technical documents.
|
|
|
|
.hy 0
|
2000-10-04 09:41:25 +04:00
|
|
|
.if n .na
|
2001-04-09 16:29:33 +04:00
|
|
|
.\"
|
|
|
|
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
|
|
|
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
2000-10-04 09:41:25 +04:00
|
|
|
.bd B 3
|
2001-04-09 16:29:33 +04:00
|
|
|
. \" fudge factors for nroff and troff
|
2000-10-04 09:41:25 +04:00
|
|
|
.if n \{\
|
2001-04-09 16:29:33 +04:00
|
|
|
. ds #H 0
|
|
|
|
. ds #V .8m
|
|
|
|
. ds #F .3m
|
|
|
|
. ds #[ \f1
|
|
|
|
. ds #] \fP
|
2000-10-04 09:41:25 +04:00
|
|
|
.\}
|
|
|
|
.if t \{\
|
2001-04-09 16:29:33 +04:00
|
|
|
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
|
|
|
. ds #V .6m
|
|
|
|
. ds #F 0
|
|
|
|
. ds #[ \&
|
|
|
|
. ds #] \&
|
2000-10-04 09:41:25 +04:00
|
|
|
.\}
|
2001-04-09 16:29:33 +04:00
|
|
|
. \" simple accents for nroff and troff
|
2000-10-04 09:41:25 +04:00
|
|
|
.if n \{\
|
2001-04-09 16:29:33 +04:00
|
|
|
. ds ' \&
|
|
|
|
. ds ` \&
|
|
|
|
. ds ^ \&
|
|
|
|
. ds , \&
|
|
|
|
. ds ~ ~
|
|
|
|
. ds /
|
2000-10-04 09:41:25 +04:00
|
|
|
.\}
|
|
|
|
.if t \{\
|
2001-04-09 16:29:33 +04:00
|
|
|
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
|
|
|
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
|
|
|
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
|
|
|
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
|
|
|
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
|
|
|
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
2000-10-04 09:41:25 +04:00
|
|
|
.\}
|
2001-04-09 16:29:33 +04:00
|
|
|
. \" troff and (daisy-wheel) nroff accents
|
2000-10-04 09:41:25 +04:00
|
|
|
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
|
|
|
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
|
|
|
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
|
|
|
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
|
|
|
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
|
|
|
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
|
|
|
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
|
|
|
.ds ae a\h'-(\w'a'u*4/10)'e
|
|
|
|
.ds Ae A\h'-(\w'A'u*4/10)'E
|
2001-04-09 16:29:33 +04:00
|
|
|
. \" corrections for vroff
|
2000-10-04 09:41:25 +04:00
|
|
|
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
|
|
|
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
2001-04-09 16:29:33 +04:00
|
|
|
. \" for low resolution devices (crt and lpr)
|
2000-10-04 09:41:25 +04:00
|
|
|
.if \n(.H>23 .if \n(.V>19 \
|
|
|
|
\{\
|
2001-04-09 16:29:33 +04:00
|
|
|
. ds : e
|
|
|
|
. ds 8 ss
|
|
|
|
. ds o a
|
|
|
|
. ds d- d\h'-1'\(ga
|
|
|
|
. ds D- D\h'-1'\(hy
|
|
|
|
. ds th \o'bp'
|
|
|
|
. ds Th \o'LP'
|
|
|
|
. ds ae ae
|
|
|
|
. ds Ae AE
|
2000-10-04 09:41:25 +04:00
|
|
|
.\}
|
|
|
|
.rm #[ #] #H #V #F C
|
2001-04-09 16:29:33 +04:00
|
|
|
.\" ======================================================================
|
|
|
|
.\"
|
|
|
|
.IX Title "X509 1"
|
|
|
|
.TH X509 1 "0.9.5a" "2000-07-23" "OpenSSL"
|
|
|
|
.UC
|
2000-10-04 09:41:25 +04:00
|
|
|
.SH "NAME"
|
|
|
|
x509 \- Certificate display and signing utility
|
|
|
|
.SH "SYNOPSIS"
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Header "SYNOPSIS"
|
|
|
|
\&\fBopenssl\fR \fBx509\fR
|
2000-10-04 09:41:25 +04:00
|
|
|
[\fB\-inform DER|PEM|NET\fR]
|
|
|
|
[\fB\-outform DER|PEM|NET\fR]
|
|
|
|
[\fB\-keyform DER|PEM\fR]
|
|
|
|
[\fB\-CAform DER|PEM\fR]
|
|
|
|
[\fB\-CAkeyform DER|PEM\fR]
|
|
|
|
[\fB\-in filename\fR]
|
|
|
|
[\fB\-out filename\fR]
|
|
|
|
[\fB\-serial\fR]
|
|
|
|
[\fB\-hash\fR]
|
|
|
|
[\fB\-subject\fR]
|
|
|
|
[\fB\-issuer\fR]
|
|
|
|
[\fB\-startdate\fR]
|
|
|
|
[\fB\-enddate\fR]
|
|
|
|
[\fB\-purpose\fR]
|
|
|
|
[\fB\-dates\fR]
|
|
|
|
[\fB\-modulus\fR]
|
|
|
|
[\fB\-fingerprint\fR]
|
|
|
|
[\fB\-alias\fR]
|
|
|
|
[\fB\-noout\fR]
|
|
|
|
[\fB\-trustout\fR]
|
|
|
|
[\fB\-clrtrust\fR]
|
|
|
|
[\fB\-clrreject\fR]
|
|
|
|
[\fB\-addtrust arg\fR]
|
|
|
|
[\fB\-addreject arg\fR]
|
|
|
|
[\fB\-setalias arg\fR]
|
|
|
|
[\fB\-days arg\fR]
|
|
|
|
[\fB\-signkey filename\fR]
|
|
|
|
[\fB\-x509toreq\fR]
|
|
|
|
[\fB\-req\fR]
|
|
|
|
[\fB\-CA filename\fR]
|
|
|
|
[\fB\-CAkey filename\fR]
|
|
|
|
[\fB\-CAcreateserial\fR]
|
|
|
|
[\fB\-CAserial filename\fR]
|
|
|
|
[\fB\-text\fR]
|
|
|
|
[\fB\-C\fR]
|
|
|
|
[\fB\-md2|\-md5|\-sha1|\-mdc2\fR]
|
|
|
|
[\fB\-clrext\fR]
|
|
|
|
[\fB\-extfile filename\fR]
|
|
|
|
[\fB\-extensions section\fR]
|
|
|
|
.SH "DESCRIPTION"
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Header "DESCRIPTION"
|
2000-10-04 09:41:25 +04:00
|
|
|
The \fBx509\fR command is a multi purpose certificate utility. It can be
|
|
|
|
used to display certificate information, convert certificates to
|
2001-04-09 16:29:33 +04:00
|
|
|
various forms, sign certificate requests like a \*(L"mini \s-1CA\s0\*(R" or edit
|
2000-10-04 09:41:25 +04:00
|
|
|
certificate trust settings.
|
|
|
|
.PP
|
|
|
|
Since there are a large number of options they will split up into
|
|
|
|
various sections.
|
|
|
|
.SH "INPUT, OUTPUT AND GENERAL PURPOSE OPTIONS"
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Header "INPUT, OUTPUT AND GENERAL PURPOSE OPTIONS"
|
|
|
|
.Ip "\fB\-inform DER|PEM|NET\fR" 4
|
|
|
|
.IX Item "-inform DER|PEM|NET"
|
2000-10-04 09:41:25 +04:00
|
|
|
This specifies the input format normally the command will expect an X509
|
|
|
|
certificate but this can change if other options such as \fB\-req\fR are
|
|
|
|
present. The \s-1DER\s0 format is the \s-1DER\s0 encoding of the certificate and \s-1PEM\s0
|
|
|
|
is the base64 encoding of the \s-1DER\s0 encoding with header and footer lines
|
|
|
|
added. The \s-1NET\s0 option is an obscure Netscape server format that is now
|
|
|
|
obsolete.
|
2001-04-09 16:29:33 +04:00
|
|
|
.Ip "\fB\-outform DER|PEM|NET\fR" 4
|
|
|
|
.IX Item "-outform DER|PEM|NET"
|
2000-10-04 09:41:25 +04:00
|
|
|
This specifies the output format, the options have the same meaning as the
|
2001-04-09 16:29:33 +04:00
|
|
|
\&\fB\-inform\fR option.
|
2000-10-04 09:41:25 +04:00
|
|
|
.Ip "\fB\-in filename\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-in filename"
|
2000-10-04 09:41:25 +04:00
|
|
|
This specifies the input filename to read a certificate from or standard input
|
|
|
|
if this option is not specified.
|
|
|
|
.Ip "\fB\-out filename\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-out filename"
|
2000-10-04 09:41:25 +04:00
|
|
|
This specifies the output filename to write to or standard output by
|
|
|
|
default.
|
|
|
|
.Ip "\fB\-md2|\-md5|\-sha1|\-mdc2\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-md2|-md5|-sha1|-mdc2"
|
2000-10-04 09:41:25 +04:00
|
|
|
the digest to use. This affects any signing or display option that uses a message
|
2001-04-09 16:29:33 +04:00
|
|
|
digest, such as the \fB\-fingerprint\fR, \fB\-signkey\fR and \fB\-CA\fR options. If not
|
2000-10-04 09:41:25 +04:00
|
|
|
specified then \s-1MD5\s0 is used. If the key being used to sign with is a \s-1DSA\s0 key then
|
|
|
|
this option has no effect: \s-1SHA1\s0 is always used with \s-1DSA\s0 keys.
|
|
|
|
.SH "DISPLAY OPTIONS"
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Header "DISPLAY OPTIONS"
|
2000-10-04 09:41:25 +04:00
|
|
|
Note: the \fB\-alias\fR and \fB\-purpose\fR options are also display options
|
2001-04-09 16:29:33 +04:00
|
|
|
but are described in the \fB\s-1TRUST\s0 \s-1OPTIONS\s0\fR section.
|
2000-10-04 09:41:25 +04:00
|
|
|
.Ip "\fB\-text\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-text"
|
2000-10-04 09:41:25 +04:00
|
|
|
prints out the certificate in text form. Full details are output including the
|
|
|
|
public key, signature algorithms, issuer and subject names, serial number
|
|
|
|
any extensions present and any trust settings.
|
|
|
|
.Ip "\fB\-noout\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-noout"
|
2000-10-04 09:41:25 +04:00
|
|
|
this option prevents output of the encoded version of the request.
|
|
|
|
.Ip "\fB\-modulus\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-modulus"
|
2000-10-04 09:41:25 +04:00
|
|
|
this option prints out the value of the modulus of the public key
|
|
|
|
contained in the certificate.
|
|
|
|
.Ip "\fB\-serial\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-serial"
|
2000-10-04 09:41:25 +04:00
|
|
|
outputs the certificate serial number.
|
|
|
|
.Ip "\fB\-hash\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-hash"
|
2000-10-04 09:41:25 +04:00
|
|
|
outputs the \*(L"hash\*(R" of the certificate subject name. This is used in OpenSSL to
|
|
|
|
form an index to allow certificates in a directory to be looked up by subject
|
|
|
|
name.
|
|
|
|
.Ip "\fB\-subject\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-subject"
|
2000-10-04 09:41:25 +04:00
|
|
|
outputs the subject name.
|
|
|
|
.Ip "\fB\-issuer\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-issuer"
|
2000-10-04 09:41:25 +04:00
|
|
|
outputs the issuer name.
|
|
|
|
.Ip "\fB\-startdate\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-startdate"
|
2000-10-04 09:41:25 +04:00
|
|
|
prints out the start date of the certificate, that is the notBefore date.
|
|
|
|
.Ip "\fB\-enddate\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-enddate"
|
2000-10-04 09:41:25 +04:00
|
|
|
prints out the expiry date of the certificate, that is the notAfter date.
|
|
|
|
.Ip "\fB\-dates\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-dates"
|
2000-10-04 09:41:25 +04:00
|
|
|
prints out the start and expiry dates of a certificate.
|
|
|
|
.Ip "\fB\-fingerprint\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-fingerprint"
|
2000-10-04 09:41:25 +04:00
|
|
|
prints out the digest of the \s-1DER\s0 encoded version of the whole certificate.
|
|
|
|
.Ip "\fB\-C\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-C"
|
2000-10-04 09:41:25 +04:00
|
|
|
this outputs the certificate in the form of a C source file.
|
|
|
|
.SH "TRUST SETTINGS"
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Header "TRUST SETTINGS"
|
2000-10-04 09:41:25 +04:00
|
|
|
Please note these options are currently experimental and may well change.
|
|
|
|
.PP
|
|
|
|
A \fBtrusted certificate\fR is an ordinary certificate which has several
|
|
|
|
additional pieces of information attached to it such as the permitted
|
|
|
|
and prohibited uses of the certificate and an \*(L"alias\*(R".
|
|
|
|
.PP
|
|
|
|
Normally when a certificate is being verified at least one certificate
|
|
|
|
must be \*(L"trusted\*(R". By default a trusted certificate must be stored
|
2001-04-09 16:29:33 +04:00
|
|
|
locally and must be a root \s-1CA:\s0 any certificate chain ending in this \s-1CA\s0
|
2000-10-04 09:41:25 +04:00
|
|
|
is then usable for any purpose.
|
|
|
|
.PP
|
2001-04-09 16:29:33 +04:00
|
|
|
Trust settings currently are only used with a root \s-1CA\s0. They allow a finer
|
|
|
|
control over the purposes the root \s-1CA\s0 can be used for. For example a \s-1CA\s0
|
|
|
|
may be trusted for \s-1SSL\s0 client but not \s-1SSL\s0 server use.
|
2000-10-04 09:41:25 +04:00
|
|
|
.PP
|
|
|
|
See the description of the \fBverify\fR utility for more information on the
|
|
|
|
meaning of trust settings.
|
|
|
|
.PP
|
|
|
|
Future versions of OpenSSL will recognize trust settings on any
|
|
|
|
certificate: not just root CAs.
|
|
|
|
.Ip "\fB\-trustout\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-trustout"
|
2000-10-04 09:41:25 +04:00
|
|
|
this causes \fBx509\fR to output a \fBtrusted\fR certificate. An ordinary
|
|
|
|
or trusted certificate can be input but by default an ordinary
|
|
|
|
certificate is output and any trust settings are discarded. With the
|
2001-04-09 16:29:33 +04:00
|
|
|
\&\fB\-trustout\fR option a trusted certificate is output. A trusted
|
2000-10-04 09:41:25 +04:00
|
|
|
certificate is automatically output if any trust settings are modified.
|
|
|
|
.Ip "\fB\-setalias arg\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-setalias arg"
|
2000-10-04 09:41:25 +04:00
|
|
|
sets the alias of the certificate. This will allow the certificate
|
|
|
|
to be referred to using a nickname for example \*(L"Steve's Certificate\*(R".
|
|
|
|
.Ip "\fB\-alias\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-alias"
|
2000-10-04 09:41:25 +04:00
|
|
|
outputs the certificate alias, if any.
|
|
|
|
.Ip "\fB\-clrtrust\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-clrtrust"
|
2000-10-04 09:41:25 +04:00
|
|
|
clears all the permitted or trusted uses of the certificate.
|
|
|
|
.Ip "\fB\-clrreject\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-clrreject"
|
2000-10-04 09:41:25 +04:00
|
|
|
clears all the prohibited or rejected uses of the certificate.
|
|
|
|
.Ip "\fB\-addtrust arg\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-addtrust arg"
|
2000-10-04 09:41:25 +04:00
|
|
|
adds a trusted certificate use. Any object name can be used here
|
|
|
|
but currently only \fBclientAuth\fR (\s-1SSL\s0 client use), \fBserverAuth\fR
|
2001-04-09 16:29:33 +04:00
|
|
|
(\s-1SSL\s0 server use) and \fBemailProtection\fR (S/MIME email) are used.
|
2000-10-04 09:41:25 +04:00
|
|
|
Other OpenSSL applications may define additional uses.
|
|
|
|
.Ip "\fB\-addreject arg\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-addreject arg"
|
2000-10-04 09:41:25 +04:00
|
|
|
adds a prohibited use. It accepts the same values as the \fB\-addtrust\fR
|
|
|
|
option.
|
|
|
|
.Ip "\fB\-purpose\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-purpose"
|
2000-10-04 09:41:25 +04:00
|
|
|
this option performs tests on the certificate extensions and outputs
|
|
|
|
the results. For a more complete description see the \fB\s-1CERTIFICATE\s0
|
2001-04-09 16:29:33 +04:00
|
|
|
\&\s-1EXTENSIONS\s0\fR section.
|
2000-10-04 09:41:25 +04:00
|
|
|
.SH "SIGNING OPTIONS"
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Header "SIGNING OPTIONS"
|
2000-10-04 09:41:25 +04:00
|
|
|
The \fBx509\fR utility can be used to sign certificates and requests: it
|
2001-04-09 16:29:33 +04:00
|
|
|
can thus behave like a \*(L"mini \s-1CA\s0\*(R".
|
2000-10-04 09:41:25 +04:00
|
|
|
.Ip "\fB\-signkey filename\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-signkey filename"
|
2000-10-04 09:41:25 +04:00
|
|
|
this option causes the input file to be self signed using the supplied
|
|
|
|
private key.
|
|
|
|
.Sp
|
|
|
|
If the input file is a certificate it sets the issuer name to the
|
|
|
|
subject name (i.e. makes it self signed) changes the public key to the
|
|
|
|
supplied value and changes the start and end dates. The start date is
|
|
|
|
set to the current time and the end date is set to a value determined
|
|
|
|
by the \fB\-days\fR option. Any certificate extensions are retained unless
|
|
|
|
the \fB\-clrext\fR option is supplied.
|
|
|
|
.Sp
|
|
|
|
If the input is a certificate request then a self signed certificate
|
|
|
|
is created using the supplied private key using the subject name in
|
|
|
|
the request.
|
|
|
|
.Ip "\fB\-clrext\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-clrext"
|
2000-10-04 09:41:25 +04:00
|
|
|
delete any extensions from a certificate. This option is used when a
|
|
|
|
certificate is being created from another certificate (for example with
|
2001-04-09 16:29:33 +04:00
|
|
|
the \fB\-signkey\fR or the \fB\-CA\fR options). Normally all extensions are
|
2000-10-04 09:41:25 +04:00
|
|
|
retained.
|
2001-04-09 16:29:33 +04:00
|
|
|
.Ip "\fB\-keyform PEM|DER\fR" 4
|
|
|
|
.IX Item "-keyform PEM|DER"
|
2000-10-04 09:41:25 +04:00
|
|
|
specifies the format (\s-1DER\s0 or \s-1PEM\s0) of the private key file used in the
|
2001-04-09 16:29:33 +04:00
|
|
|
\&\fB\-signkey\fR option.
|
2000-10-04 09:41:25 +04:00
|
|
|
.Ip "\fB\-days arg\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-days arg"
|
2000-10-04 09:41:25 +04:00
|
|
|
specifies the number of days to make a certificate valid for. The default
|
|
|
|
is 30 days.
|
|
|
|
.Ip "\fB\-x509toreq\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-x509toreq"
|
2000-10-04 09:41:25 +04:00
|
|
|
converts a certificate into a certificate request. The \fB\-signkey\fR option
|
|
|
|
is used to pass the required private key.
|
|
|
|
.Ip "\fB\-req\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-req"
|
2000-10-04 09:41:25 +04:00
|
|
|
by default a certificate is expected on input. With this option a
|
|
|
|
certificate request is expected instead.
|
2001-04-09 16:29:33 +04:00
|
|
|
.Ip "\fB\-CA filename\fR" 4
|
|
|
|
.IX Item "-CA filename"
|
2000-10-04 09:41:25 +04:00
|
|
|
specifies the \s-1CA\s0 certificate to be used for signing. When this option is
|
|
|
|
present \fBx509\fR behaves like a \*(L"mini \s-1CA\s0\*(R". The input file is signed by this
|
2001-04-09 16:29:33 +04:00
|
|
|
\&\s-1CA\s0 using this option: that is its issuer name is set to the subject name
|
2000-10-04 09:41:25 +04:00
|
|
|
of the \s-1CA\s0 and it is digitally signed using the CAs private key.
|
|
|
|
.Sp
|
|
|
|
This option is normally combined with the \fB\-req\fR option. Without the
|
2001-04-09 16:29:33 +04:00
|
|
|
\&\fB\-req\fR option the input is a certificate which must be self signed.
|
2000-10-04 09:41:25 +04:00
|
|
|
.Ip "\fB\-CAkey filename\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-CAkey filename"
|
2000-10-04 09:41:25 +04:00
|
|
|
sets the \s-1CA\s0 private key to sign a certificate with. If this option is
|
|
|
|
not specified then it is assumed that the \s-1CA\s0 private key is present in
|
|
|
|
the \s-1CA\s0 certificate file.
|
|
|
|
.Ip "\fB\-CAserial filename\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-CAserial filename"
|
2000-10-04 09:41:25 +04:00
|
|
|
sets the \s-1CA\s0 serial number file to use.
|
|
|
|
.Sp
|
2001-04-09 16:29:33 +04:00
|
|
|
When the \fB\-CA\fR option is used to sign a certificate it uses a serial
|
2000-10-04 09:41:25 +04:00
|
|
|
number specified in a file. This file consist of one line containing
|
|
|
|
an even number of hex digits with the serial number to use. After each
|
|
|
|
use the serial number is incremented and written out to the file again.
|
|
|
|
.Sp
|
|
|
|
The default filename consists of the \s-1CA\s0 certificate file base name with
|
2001-04-09 16:29:33 +04:00
|
|
|
\&\*(L".srl\*(R" appended. For example if the \s-1CA\s0 certificate file is called
|
|
|
|
\&\*(L"mycacert.pem\*(R" it expects to find a serial number file called \*(L"mycacert.srl\*(R".
|
2000-10-04 09:41:25 +04:00
|
|
|
.Ip "\fB\-CAcreateserial filename\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-CAcreateserial filename"
|
2000-10-04 09:41:25 +04:00
|
|
|
with this option the \s-1CA\s0 serial number file is created if it does not exist:
|
|
|
|
it will contain the serial number \*(L"02\*(R" and the certificate being signed will
|
2001-04-09 16:29:33 +04:00
|
|
|
have the 1 as its serial number. Normally if the \fB\-CA\fR option is specified
|
2000-10-04 09:41:25 +04:00
|
|
|
and the serial number file does not exist it is an error.
|
|
|
|
.Ip "\fB\-extfile filename\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-extfile filename"
|
2000-10-04 09:41:25 +04:00
|
|
|
file containing certificate extensions to use. If not specified then
|
|
|
|
no extensions are added to the certificate.
|
|
|
|
.Ip "\fB\-extensions section\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "-extensions section"
|
2000-10-04 09:41:25 +04:00
|
|
|
the section to add certificate extensions from. If this option is not
|
|
|
|
specified then the extensions should either be contained in the unnamed
|
|
|
|
(default) section or the default section should contain a variable called
|
2001-04-09 16:29:33 +04:00
|
|
|
\&\*(L"extensions\*(R" which contains the section to use.
|
2000-10-04 09:41:25 +04:00
|
|
|
.SH "EXAMPLES"
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Header "EXAMPLES"
|
|
|
|
Note: in these examples the '\e' means the example should be all on one
|
2000-10-04 09:41:25 +04:00
|
|
|
line.
|
|
|
|
.PP
|
|
|
|
Display the contents of a certificate:
|
|
|
|
.PP
|
|
|
|
.Vb 1
|
|
|
|
\& openssl x509 -in cert.pem -noout -text
|
|
|
|
.Ve
|
|
|
|
Display the certificate serial number:
|
|
|
|
.PP
|
|
|
|
.Vb 1
|
|
|
|
\& openssl x509 -in cert.pem -noout -serial
|
|
|
|
.Ve
|
2001-04-09 16:29:33 +04:00
|
|
|
Display the certificate \s-1MD5\s0 fingerprint:
|
2000-10-04 09:41:25 +04:00
|
|
|
.PP
|
|
|
|
.Vb 1
|
|
|
|
\& openssl x509 -in cert.pem -noout -fingerprint
|
|
|
|
.Ve
|
2001-04-09 16:29:33 +04:00
|
|
|
Display the certificate \s-1SHA1\s0 fingerprint:
|
2000-10-04 09:41:25 +04:00
|
|
|
.PP
|
|
|
|
.Vb 1
|
|
|
|
\& openssl x509 -sha1 -in cert.pem -noout -fingerprint
|
|
|
|
.Ve
|
2001-04-09 16:29:33 +04:00
|
|
|
Convert a certificate from \s-1PEM\s0 to \s-1DER\s0 format:
|
2000-10-04 09:41:25 +04:00
|
|
|
.PP
|
|
|
|
.Vb 1
|
|
|
|
\& openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER
|
|
|
|
.Ve
|
|
|
|
Convert a certificate to a certificate request:
|
|
|
|
.PP
|
|
|
|
.Vb 1
|
|
|
|
\& openssl x509 -x509toreq -in cert.pem -out req.pem -signkey key.pem
|
|
|
|
.Ve
|
|
|
|
Convert a certificate request into a self signed certificate using
|
2001-04-09 16:29:33 +04:00
|
|
|
extensions for a \s-1CA:\s0
|
2000-10-04 09:41:25 +04:00
|
|
|
.PP
|
|
|
|
.Vb 2
|
|
|
|
\& openssl x509 -req -in careq.pem -config openssl.cnf -extensions v3_ca \e
|
|
|
|
\& -signkey key.pem -out cacert.pem
|
|
|
|
.Ve
|
2001-04-09 16:29:33 +04:00
|
|
|
Sign a certificate request using the \s-1CA\s0 certificate above and add user
|
2000-10-04 09:41:25 +04:00
|
|
|
certificate extensions:
|
|
|
|
.PP
|
|
|
|
.Vb 2
|
|
|
|
\& openssl x509 -req -in req.pem -config openssl.cnf -extensions v3_usr \e
|
|
|
|
\& -CA cacert.pem -CAkey key.pem -CAcreateserial
|
|
|
|
.Ve
|
2001-04-09 16:29:33 +04:00
|
|
|
Set a certificate to be trusted for \s-1SSL\s0 client use and change set its alias to
|
|
|
|
\&\*(L"Steve's Class 1 \s-1CA\s0\*(R"
|
2000-10-04 09:41:25 +04:00
|
|
|
.PP
|
|
|
|
.Vb 2
|
|
|
|
\& openssl x509 -in cert.pem -addtrust sslclient \e
|
|
|
|
\& -alias "Steve's Class 1 CA" -out trust.pem
|
|
|
|
.Ve
|
|
|
|
.SH "NOTES"
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Header "NOTES"
|
|
|
|
The \s-1PEM\s0 format uses the header and footer lines:
|
2000-10-04 09:41:25 +04:00
|
|
|
.PP
|
|
|
|
.Vb 2
|
|
|
|
\& -----BEGIN CERTIFICATE----
|
|
|
|
\& -----END CERTIFICATE----
|
|
|
|
.Ve
|
|
|
|
it will also handle files containing:
|
|
|
|
.PP
|
|
|
|
.Vb 2
|
|
|
|
\& -----BEGIN X509 CERTIFICATE----
|
|
|
|
\& -----END X509 CERTIFICATE----
|
|
|
|
.Ve
|
|
|
|
Trusted certificates have the lines
|
|
|
|
.PP
|
|
|
|
.Vb 2
|
|
|
|
\& -----BEGIN TRUSTED CERTIFICATE----
|
|
|
|
\& -----END TRUSTED CERTIFICATE----
|
|
|
|
.Ve
|
2001-04-09 16:29:33 +04:00
|
|
|
The \fB\-fingerprint\fR option takes the digest of the \s-1DER\s0 encoded certificate.
|
2000-10-04 09:41:25 +04:00
|
|
|
This is commonly called a \*(L"fingerprint\*(R". Because of the nature of message
|
|
|
|
digests the fingerprint of a certificate is unique to that certificate and
|
|
|
|
two certificates with the same fingerprint can be considered to be the same.
|
|
|
|
.PP
|
2001-04-09 16:29:33 +04:00
|
|
|
The Netscape fingerprint uses \s-1MD5\s0 whereas \s-1MSIE\s0 uses \s-1SHA1\s0.
|
2000-10-04 09:41:25 +04:00
|
|
|
.SH "CERTIFICATE EXTENSIONS"
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Header "CERTIFICATE EXTENSIONS"
|
2000-10-04 09:41:25 +04:00
|
|
|
The \fB\-purpose\fR option checks the certificate extensions and determines
|
|
|
|
what the certificate can be used for. The actual checks done are rather
|
|
|
|
complex and include various hacks and workarounds to handle broken
|
|
|
|
certificates and software.
|
|
|
|
.PP
|
|
|
|
The same code is used when verifying untrusted certificates in chains
|
|
|
|
so this section is useful if a chain is rejected by the verify code.
|
|
|
|
.PP
|
2001-04-09 16:29:33 +04:00
|
|
|
The basicConstraints extension \s-1CA\s0 flag is used to determine whether the
|
|
|
|
certificate can be used as a \s-1CA\s0. If the \s-1CA\s0 flag is true then it is a \s-1CA\s0,
|
|
|
|
if the \s-1CA\s0 flag is false then it is not a \s-1CA\s0. \fBAll\fR CAs should have the
|
|
|
|
\&\s-1CA\s0 flag set to true.
|
2000-10-04 09:41:25 +04:00
|
|
|
.PP
|
|
|
|
If the basicConstraints extension is absent then the certificate is
|
2001-04-09 16:29:33 +04:00
|
|
|
considered to be a \*(L"possible \s-1CA\s0\*(R" other extensions are checked according
|
2000-10-04 09:41:25 +04:00
|
|
|
to the intended use of the certificate. A warning is given in this case
|
2001-04-09 16:29:33 +04:00
|
|
|
because the certificate should really not be regarded as a \s-1CA:\s0 however
|
|
|
|
it is allowed to be a \s-1CA\s0 to work around some broken software.
|
2000-10-04 09:41:25 +04:00
|
|
|
.PP
|
|
|
|
If the certificate is a V1 certificate (and thus has no extensions) and
|
2001-04-09 16:29:33 +04:00
|
|
|
it is self signed it is also assumed to be a \s-1CA\s0 but a warning is again
|
2000-10-04 09:41:25 +04:00
|
|
|
given: this is to work around the problem of Verisign roots which are V1
|
|
|
|
self signed certificates.
|
|
|
|
.PP
|
|
|
|
If the keyUsage extension is present then additional restraints are
|
2001-04-09 16:29:33 +04:00
|
|
|
made on the uses of the certificate. A \s-1CA\s0 certificate \fBmust\fR have the
|
2000-10-04 09:41:25 +04:00
|
|
|
keyCertSign bit set if the keyUsage extension is present.
|
|
|
|
.PP
|
|
|
|
The extended key usage extension places additional restrictions on the
|
|
|
|
certificate uses. If this extension is present (whether critical or not)
|
|
|
|
the key can only be used for the purposes specified.
|
|
|
|
.PP
|
|
|
|
A complete description of each test is given below. The comments about
|
|
|
|
basicConstraints and keyUsage and V1 certificates above apply to \fBall\fR
|
2001-04-09 16:29:33 +04:00
|
|
|
\&\s-1CA\s0 certificates.
|
2000-10-04 09:41:25 +04:00
|
|
|
.Ip "\fB\s-1SSL\s0 Client\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "SSL Client"
|
2000-10-04 09:41:25 +04:00
|
|
|
The extended key usage extension must be absent or include the \*(L"web client
|
|
|
|
authentication\*(R" \s-1OID\s0. keyUsage must be absent or it must have the
|
|
|
|
digitalSignature bit set. Netscape certificate type must be absent or it must
|
|
|
|
have the \s-1SSL\s0 client bit set.
|
|
|
|
.Ip "\fB\s-1SSL\s0 Client \s-1CA\s0\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "SSL Client CA"
|
2000-10-04 09:41:25 +04:00
|
|
|
The extended key usage extension must be absent or include the \*(L"web client
|
|
|
|
authentication\*(R" \s-1OID\s0. Netscape certificate type must be absent or it must have
|
|
|
|
the \s-1SSL\s0 \s-1CA\s0 bit set: this is used as a work around if the basicConstraints
|
|
|
|
extension is absent.
|
|
|
|
.Ip "\fB\s-1SSL\s0 Server\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "SSL Server"
|
2000-10-04 09:41:25 +04:00
|
|
|
The extended key usage extension must be absent or include the \*(L"web server
|
|
|
|
authentication\*(R" and/or one of the \s-1SGC\s0 OIDs. keyUsage must be absent or it
|
|
|
|
must have the digitalSignature, the keyEncipherment set or both bits set.
|
|
|
|
Netscape certificate type must be absent or have the \s-1SSL\s0 server bit set.
|
|
|
|
.Ip "\fB\s-1SSL\s0 Server \s-1CA\s0\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "SSL Server CA"
|
2000-10-04 09:41:25 +04:00
|
|
|
The extended key usage extension must be absent or include the \*(L"web server
|
|
|
|
authentication\*(R" and/or one of the \s-1SGC\s0 OIDs. Netscape certificate type must
|
|
|
|
be absent or the \s-1SSL\s0 \s-1CA\s0 bit must be set: this is used as a work around if the
|
|
|
|
basicConstraints extension is absent.
|
|
|
|
.Ip "\fBNetscape \s-1SSL\s0 Server\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "Netscape SSL Server"
|
2000-10-04 09:41:25 +04:00
|
|
|
For Netscape \s-1SSL\s0 clients to connect to an \s-1SSL\s0 server it must have the
|
|
|
|
keyEncipherment bit set if the keyUsage extension is present. This isn't
|
|
|
|
always valid because some cipher suites use the key for digital signing.
|
|
|
|
Otherwise it is the same as a normal \s-1SSL\s0 server.
|
2001-04-09 16:29:33 +04:00
|
|
|
.Ip "\fBCommon S/MIME Client Tests\fR" 4
|
|
|
|
.IX Item "Common S/MIME Client Tests"
|
2000-10-04 09:41:25 +04:00
|
|
|
The extended key usage extension must be absent or include the \*(L"email
|
|
|
|
protection\*(R" \s-1OID\s0. Netscape certificate type must be absent or should have the
|
2001-04-09 16:29:33 +04:00
|
|
|
S/MIME bit set. If the S/MIME bit is not set in netscape certificate type
|
2000-10-04 09:41:25 +04:00
|
|
|
then the \s-1SSL\s0 client bit is tolerated as an alternative but a warning is shown:
|
2001-04-09 16:29:33 +04:00
|
|
|
this is because some Verisign certificates don't set the S/MIME bit.
|
|
|
|
.Ip "\fBS/MIME Signing\fR" 4
|
|
|
|
.IX Item "S/MIME Signing"
|
|
|
|
In addition to the common S/MIME client tests the digitalSignature bit must
|
2000-10-04 09:41:25 +04:00
|
|
|
be set if the keyUsage extension is present.
|
2001-04-09 16:29:33 +04:00
|
|
|
.Ip "\fBS/MIME Encryption\fR" 4
|
|
|
|
.IX Item "S/MIME Encryption"
|
|
|
|
In addition to the common S/MIME tests the keyEncipherment bit must be set
|
2000-10-04 09:41:25 +04:00
|
|
|
if the keyUsage extension is present.
|
2001-04-09 16:29:33 +04:00
|
|
|
.Ip "\fBS/MIME \s-1CA\s0\fR" 4
|
|
|
|
.IX Item "S/MIME CA"
|
2000-10-04 09:41:25 +04:00
|
|
|
The extended key usage extension must be absent or include the \*(L"email
|
|
|
|
protection\*(R" \s-1OID\s0. Netscape certificate type must be absent or must have the
|
2001-04-09 16:29:33 +04:00
|
|
|
S/MIME \s-1CA\s0 bit set: this is used as a work around if the basicConstraints
|
2000-10-04 09:41:25 +04:00
|
|
|
extension is absent.
|
|
|
|
.Ip "\fB\s-1CRL\s0 Signing\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "CRL Signing"
|
2000-10-04 09:41:25 +04:00
|
|
|
The keyUsage extension must be absent or it must have the \s-1CRL\s0 signing bit
|
|
|
|
set.
|
|
|
|
.Ip "\fB\s-1CRL\s0 Signing \s-1CA\s0\fR" 4
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Item "CRL Signing CA"
|
2000-10-04 09:41:25 +04:00
|
|
|
The normal \s-1CA\s0 tests apply. Except in this case the basicConstraints extension
|
|
|
|
must be present.
|
|
|
|
.SH "BUGS"
|
2001-04-09 16:29:33 +04:00
|
|
|
.IX Header "BUGS"
|
2000-10-04 09:41:25 +04:00
|
|
|
The way DNs are printed is in a \*(L"historical SSLeay\*(R" format which doesn't
|
2001-04-09 16:29:33 +04:00
|
|
|
follow any published standard. It should follow some standard like \s-1RFC2253\s0
|
|
|
|
or \s-1RFC1779\s0 with options to make the stuff more readable.
|
2000-10-04 09:41:25 +04:00
|
|
|
.PP
|
|
|
|
Extensions in certificates are not transferred to certificate requests and
|
|
|
|
vice versa.
|
|
|
|
.PP
|
|
|
|
It is possible to produce invalid certificates or requests by specifying the
|
|
|
|
wrong private key or using inconsistent options in some cases: these should
|
|
|
|
be checked.
|
|
|
|
.PP
|
|
|
|
There should be options to explicitly set such things as start and end
|
|
|
|
dates rather than an offset from the current time.
|
|
|
|
.PP
|
2001-04-09 16:29:33 +04:00
|
|
|
The code to implement the verify behaviour described in the \fB\s-1TRUST\s0 \s-1SETTINGS\s0\fR
|
2000-10-04 09:41:25 +04:00
|
|
|
is currently being developed. It thus describes the intended behavior rather
|
|
|
|
than the current behaviour. It is hoped that it will represent reality in
|
|
|
|
OpenSSL 0.9.5 and later.
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.IX Header "SEE ALSO"
|
2001-04-09 16:29:33 +04:00
|
|
|
req(1), ca(1), genrsa(1),
|
|
|
|
gendsa(1), verify(1)
|