NetBSD/lib/libcrypto/man/openssl.1

503 lines
16 KiB
Groff

.rn '' }`
'''
'''
.de Sh
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp
.if t .sp .5v
.if n .sp
..
.de Ip
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.de Vb
.ft CW
.nf
.ne \\$1
..
.de Ve
.ft R
.fi
..
'''
'''
''' Set up \*(-- to give an unbreakable dash;
''' string Tr holds user defined translation string.
''' Bell System Logo is used as a dummy character.
'''
.tr \(*W-|\(bv\*(Tr
.ie n \{\
.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" ""
''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of
''' \*(L" and \*(R", except that they are used on ".xx" lines,
''' such as .IP and .SH, which do another additional levels of
''' double-quote interpretation
.ds M" """
.ds S" """
.ds N" """""
.ds T" """""
.ds L' '
.ds R' '
.ds M' '
.ds S' '
.ds N' '
.ds T' '
'br\}
.el\{\
.ds -- \(em\|
.tr \*(Tr
.ds L" ``
.ds R" ''
.ds M" ``
.ds S" ''
.ds N" ``
.ds T" ''
.ds L' `
.ds R' '
.ds M' `
.ds S' '
.ds N' `
.ds T' '
.ds PI \(*p
'br\}
.\" If the F register is turned on, we'll generate
.\" index entries out stderr for the following things:
.\" TH Title
.\" SH Header
.\" Sh Subsection
.\" Ip Item
.\" X<> Xref (embedded
.\" Of course, you have to process the output yourself
.\" in some meaninful fashion.
.if \nF \{
.de IX
.tm Index:\\$1\t\\n%\t"\\$2"
..
.nr % 0
.rr F
.\}
.TH OPENSSL 1 "0.9.5a" "22/Jul/2000" "OpenSSL"
.UC
.if n .hy 0
.if n .na
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.de CQ \" put $1 in typewriter font
.ft CW
'if n "\c
'if t \\&\\$1\c
'if n \\&\\$1\c
'if n \&"
\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
'.ft R
..
.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
. \" AM - accent mark definitions
.bd B 3
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds ? ?
. ds ! !
. ds /
. ds q
.\}
.if t \{\
. 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 ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
. ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
. ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
.\}
. \" troff and (daisy-wheel) nroff accents
.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 v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
.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
.ds oe o\h'-(\w'o'u*4/10)'e
.ds Oe O\h'-(\w'O'u*4/10)'E
. \" corrections for vroff
.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'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds v \h'-1'\o'\(aa\(ga'
. ds _ \h'-1'^
. ds . \h'-1'.
. ds 3 3
. 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
. ds oe oe
. ds Oe OE
.\}
.rm #[ #] #H #V #F C
.SH "NAME"
openssl \- OpenSSL command line tool
.SH "SYNOPSIS"
\fBopenssl\fR
\fIcommand\fR
[ \fIcommand_opts\fR ]
[ \fIcommand_args\fR ]
.PP
\fBopenssl\fR [ \fBlist-standard-commands\fR | \fBlist-message-digest-commands\fR | \fBlist-cipher-commands\fR ]
.PP
\fBopenssl\fR \fBno-\fR\fIXXX\fR [ \fIarbitrary options\fR ]
.SH "DESCRIPTION"
OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL
v2/v3) and Transport Layer Security (TLS v1) network protocols and related
cryptography standards required by them.
.PP
The \fBopenssl\fR program is a command line tool for using the various
cryptography functions of OpenSSL's \fBcrypto\fR library from the shell.
It can be used for
.PP
.Vb 6
\& o Creation of RSA, DH and DSA key parameters
\& o Creation of X.509 certificates, CSRs and CRLs
\& o Calculation of Message Digests
\& o Encryption and Decryption with Ciphers
\& o SSL/TLS Client and Server Tests
\& o Handling of S/MIME signed or encrypted mail
.Ve
.SH "COMMAND SUMMARY"
The \fBopenssl\fR program provides a rich variety of commands (\fIcommand\fR in the
SYNOPSIS above), each of which often has a wealth of options and arguments
(\fIcommand_opts\fR and \fIcommand_args\fR in the SYNOPSIS).
.PP
The pseudo-commands \fBlist-standard-commands\fR, \fBlist-message-digest-commands\fR,
and \fBlist-cipher-commands\fR output a list (one entry per line) of the names
of all standard commands, message digest commands, or cipher commands,
respectively, that are available in the present \fBopenssl\fR utility.
.PP
The pseudo-command \fBno-\fR\fIXXX\fR tests whether a command of the
specified name is available. If no command named \fIXXX\fR exists, it
returns 0 (success) and prints \fBno-\fR\fIXXX\fR; otherwise it returns 1
and prints \fIXXX\fR. In both cases, the output goes to \fBstdout\fR and
nothing is printed to \fBstderr\fR. Additional command line arguments
are always ignored. Since for each cipher there is a command of the
same name, this provides an easy way for shell scripts to test for the
availability of ciphers in the \fBopenssl\fR program. (\fBno-\fR\fIXXX\fR is
not able to detect pseudo-commands such as \fBquit\fR,
\fBlist-\fR\fI...\fR\fB\-commands\fR, or \fBno-\fR\fIXXX\fR itself.)
.Sh "\s-1STANDARD\s0 \s-1COMMANDS\s0"
.Ip "the section on \fI\fBasn1parse\fR|asn1parse(1)\fR" 10
Parse an \s-1ASN\s0.1 sequence.
.Ip "the section on \fI\fBca\fR|ca(1)\fR" 10
Certificate Authority (\s-1CA\s0) Management.
.Ip "the section on \fI\fBciphers\fR|ciphers(1)\fR" 10
Cipher Suite Description Determination.
.Ip "the section on \fI\fBcrl\fR|crl(1)\fR" 10
Certificate Revocation List (\s-1CRL\s0) Management.
.Ip "the section on \fI\fBcrl2pkcs7\fR|crl2pkcs7(1)\fR" 10
\s-1CRL\s0 to \s-1PKCS\s0#7 Conversion.
.Ip "the section on \fI\fBdgst\fR|dgst(1)\fR" 10
Message Digest Calculation.
.Ip "the section on \fI\fBdh\fR|dh(1)\fR" 10
Diffie-Hellman Data Management.
.Ip "the section on \fI\fBdsa\fR|dsa(1)\fR" 10
\s-1DSA\s0 Data Management.
.Ip "the section on \fI\fBdsaparam\fR|dsaparam(1)\fR" 10
\s-1DSA\s0 Parameter Generation.
.Ip "the section on \fI\fBenc\fR|enc(1)\fR" 10
Encoding with Ciphers.
.Ip "the section on \fI\fBerrstr\fR|errstr(1)\fR" 10
Error Number to Error String Conversion.
.Ip "the section on \fI\fBgendh\fR|gendh(1)\fR" 10
Generation of Diffie-Hellman Parameters.
.Ip "the section on \fI\fBgendsa\fR|gendsa(1)\fR" 10
Generation of \s-1DSA\s0 Parameters.
.Ip "the section on \fI\fBgenrsa\fR|genrsa(1)\fR" 10
Generation of \s-1RSA\s0 Parameters.
.Ip "the section on \fI\fBpasswd\fR|passwd(1)\fR" 10
Generation of hashed passwords.
.Ip "the section on \fI\fBpkcs7\fR|pkcs7(1)\fR" 10
\s-1PKCS\s0#7 Data Management.
.Ip "the section on \fI\fBrand\fR|rand(1)\fR" 10
Generate pseudo-random bytes.
.Ip "the section on \fI\fBreq\fR|req(1)\fR" 10
X.509 Certificate Signing Request (\s-1CSR\s0) Management.
.Ip "the section on \fI\fBrsa\fR|rsa(1)\fR" 10
\s-1RSA\s0 Data Management.
.Ip "the section on \fI\fBs_client\fR|s_client(1)\fR" 10
This implements a generic \s-1SSL/TLS\s0 client which can establish a transparent
connection to a remote server speaking \s-1SSL/TLS\s0. It's intended for testing
purposes only and provides only rudimentary interface functionality but
internally uses mostly all functionality of the OpenSSL \fBssl\fR library.
.Ip "the section on \fI\fBs_server\fR|s_server(1)\fR" 10
This implements a generic \s-1SSL/TLS\s0 server which accepts connections from remote
clients speaking \s-1SSL/TLS\s0. It's intended for testing purposes only and provides
only rudimentary interface functionality but internally uses mostly all
functionality of the OpenSSL \fBssl\fR library. It provides both an own command
line oriented protocol for testing \s-1SSL\s0 functions and a simple \s-1HTTP\s0 response
facility to emulate an \s-1SSL/TLS\s0\-aware webserver.
.Ip "the section on \fI\fBs_time\fR|s_time(1)\fR" 10
\s-1SSL\s0 Connection Timer.
.Ip "the section on \fI\fBsess_id\fR|sess_id(1)\fR" 10
\s-1SSL\s0 Session Data Management.
.Ip "the section on \fI\fBsmime\fR|smime(1)\fR" 10
S/\s-1MIME\s0 mail processing.
.Ip "the section on \fI\fBspeed\fR|speed(1)\fR" 10
Algorithm Speed Measurement.
.Ip "the section on \fI\fBverify\fR|verify(1)\fR" 10
X.509 Certificate Verification.
.Ip "the section on \fI\fBversion\fR|version(1)\fR" 10
OpenSSL Version Information.
.Ip "the section on \fI\fBx509\fR|x509(1)\fR" 10
X.509 Certificate Data Management.
.Sh "\s-1MESSAGE\s0 \s-1DIGEST\s0 \s-1COMMANDS\s0"
.Ip "\fBmd2\fR" 10
\s-1MD2\s0 Digest
.Ip "\fBmd5\fR" 10
\s-1MD5\s0 Digest
.Ip "\fBmdc2\fR" 10
\s-1MDC2\s0 Digest
.Ip "\fBrmd160\fR" 10
\s-1RMD\s0\-160 Digest
.Ip "\fBsha\fR " 10
\s-1SHA\s0 Digest
.Ip "\fBsha1\fR " 10
\s-1SHA\s0\-1 Digest
.Sh "\s-1ENCODING\s0 \s-1AND\s0 \s-1CIPHER\s0 \s-1COMMANDS\s0"
.Ip "\fBbase64\fR" 10
Base64 Encoding
.Ip "\fBbf bf-cbc bf-cfb bf-ecb bf-ofb\fR" 10
Blowfish Cipher
.Ip "\fBcast cast-cbc\fR" 10
\s-1CAST\s0 Cipher
.Ip "\fBcast5-cbc cast5-cfb cast5-ecb cast5-ofb\fR" 10
\s-1CAST5\s0 Cipher
.Ip "\fBdes des-cbc des-cfb des-ecb des-ede des-ede-cbc des-ede-cfb des-ede-ofb des-ofb\fR" 10
\s-1DES\s0 Cipher
.Ip "\fBdes3 desx des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb\fR" 10
Triple-\s-1DES\s0 Cipher
.Ip "\fBidea idea-cbc idea-cfb idea-ecb idea-ofb\fR" 10
\s-1IDEA\s0 Cipher
.Ip "\fBrc2 rc2-cbc rc2-cfb rc2-ecb rc2-ofb\fR" 10
\s-1RC2\s0 Cipher
.Ip "\fBrc4\fR" 10
\s-1RC4\s0 Cipher
.Ip "\fBrc5 rc5-cbc rc5-cfb rc5-ecb rc5-ofb\fR" 10
\s-1RC5\s0 Cipher
.SH "PASS PHRASE ARGUMENTS"
Several commands accept password arguments, typically using \fB\-passin\fR
and \fB\-passout\fR for input and output passwords respectively. These allow
the password to be obtained from a variety of sources. Both of these
options take a single argument whose format is described below. If no
password argument is given and a password is required then the user is
prompted to enter one: this will typically be read from the current
terminal with echoing turned off.
.Ip "\fBpass:password\fR" 10
the actual password is \fBpassword\fR. Since the password is visible
to utilities (like \*(L'ps\*(R' under Unix) this form should only be used
where security is not important.
.Ip "\fBenv:var\fR" 10
obtain the password from the environment variable \fBvar\fR. Since
the environment of other processes is visible on certain platforms
(e.g. ps under certain Unix OSes) this option should be used with caution.
.Ip "\fBfile:pathname\fR" 10
the first line of \fBpathname\fR is the password. If the same \fBpathname\fR
argument is supplied to \fB\-passin\fR and \fB\-passout\fR arguments then the first
line will be used for the input password and the next line for the output
password. \fBpathname\fR need not refer to a regular file: it could for example
refer to a device or named pipe.
.Ip "\fBfd:number\fR" 10
read the password from the file descriptor \fBnumber\fR. This can be used to
send the data via a pipe for example.
.Ip "\fBstdin\fR" 10
read the password from standard input.
.SH "SEE ALSO"
the \fIasn1parse(1)|asn1parse(1)\fR manpage, the \fIca(1)|ca(1)\fR manpage, the \fIconfig(5)|config(5)\fR manpage,
the \fIcrl(1)|crl(1)\fR manpage, the \fIcrl2pkcs7(1)|crl2pkcs7(1)\fR manpage, the \fIdgst(1)|dgst(1)\fR manpage,
the \fIdhparam(1)|dhparam(1)\fR manpage, the \fIdsa(1)|dsa(1)\fR manpage, the \fIdsaparam(1)|dsaparam(1)\fR manpage,
the \fIenc(1)|enc(1)\fR manpage, the \fIgendsa(1)|gendsa(1)\fR manpage,
the \fIgenrsa(1)|genrsa(1)\fR manpage, the \fInseq(1)|nseq(1)\fR manpage, the \fIopenssl(1)|openssl(1)\fR manpage,
the \fIpasswd(1)|passwd(1)\fR manpage,
the \fIpkcs12(1)|pkcs12(1)\fR manpage, the \fIpkcs7(1)|pkcs7(1)\fR manpage, the \fIpkcs8(1)|pkcs8(1)\fR manpage,
the \fIrand(1)|rand(1)\fR manpage, the \fIreq(1)|req(1)\fR manpage, the \fIrsa(1)|rsa(1)\fR manpage, the \fIs_client(1)|s_client(1)\fR manpage,
the \fIs_server(1)|s_server(1)\fR manpage, the \fIsmime(1)|smime(1)\fR manpage, the \fIspkac(1)|spkac(1)\fR manpage,
the \fIverify(1)|verify(1)\fR manpage, the \fIversion(1)|version(1)\fR manpage, the \fIx509(1)|x509(1)\fR manpage,
the \fIcrypto(3)|crypto(3)\fR manpage, the \fIssl(3)|ssl(3)\fR manpage
.SH "HISTORY"
The \fIopenssl\fR\|(1) document appeared in OpenSSL 0.9.2.
The \fBlist-\fR\fIXXX\fR\fB\-commands\fR pseudo-commands were added in OpenSSL 0.9.3;
the \fBno-\fR\fIXXX\fR pseudo-commands were added in OpenSSL 0.9.5a.
For notes on the availability of other commands, see their individual
manual pages.
.rn }` ''
.IX Title "OPENSSL 1"
.IX Name "openssl - OpenSSL command line tool"
.IX Header "NAME"
.IX Header "SYNOPSIS"
.IX Header "DESCRIPTION"
.IX Header "COMMAND SUMMARY"
.IX Subsection "\s-1STANDARD\s0 \s-1COMMANDS\s0"
.IX Item "the section on \fI\fBasn1parse\fR|asn1parse(1)\fR"
.IX Item "the section on \fI\fBca\fR|ca(1)\fR"
.IX Item "the section on \fI\fBciphers\fR|ciphers(1)\fR"
.IX Item "the section on \fI\fBcrl\fR|crl(1)\fR"
.IX Item "the section on \fI\fBcrl2pkcs7\fR|crl2pkcs7(1)\fR"
.IX Item "the section on \fI\fBdgst\fR|dgst(1)\fR"
.IX Item "the section on \fI\fBdh\fR|dh(1)\fR"
.IX Item "the section on \fI\fBdsa\fR|dsa(1)\fR"
.IX Item "the section on \fI\fBdsaparam\fR|dsaparam(1)\fR"
.IX Item "the section on \fI\fBenc\fR|enc(1)\fR"
.IX Item "the section on \fI\fBerrstr\fR|errstr(1)\fR"
.IX Item "the section on \fI\fBgendh\fR|gendh(1)\fR"
.IX Item "the section on \fI\fBgendsa\fR|gendsa(1)\fR"
.IX Item "the section on \fI\fBgenrsa\fR|genrsa(1)\fR"
.IX Item "the section on \fI\fBpasswd\fR|passwd(1)\fR"
.IX Item "the section on \fI\fBpkcs7\fR|pkcs7(1)\fR"
.IX Item "the section on \fI\fBrand\fR|rand(1)\fR"
.IX Item "the section on \fI\fBreq\fR|req(1)\fR"
.IX Item "the section on \fI\fBrsa\fR|rsa(1)\fR"
.IX Item "the section on \fI\fBs_client\fR|s_client(1)\fR"
.IX Item "the section on \fI\fBs_server\fR|s_server(1)\fR"
.IX Item "the section on \fI\fBs_time\fR|s_time(1)\fR"
.IX Item "the section on \fI\fBsess_id\fR|sess_id(1)\fR"
.IX Item "the section on \fI\fBsmime\fR|smime(1)\fR"
.IX Item "the section on \fI\fBspeed\fR|speed(1)\fR"
.IX Item "the section on \fI\fBverify\fR|verify(1)\fR"
.IX Item "the section on \fI\fBversion\fR|version(1)\fR"
.IX Item "the section on \fI\fBx509\fR|x509(1)\fR"
.IX Subsection "\s-1MESSAGE\s0 \s-1DIGEST\s0 \s-1COMMANDS\s0"
.IX Item "\fBmd2\fR"
.IX Item "\fBmd5\fR"
.IX Item "\fBmdc2\fR"
.IX Item "\fBrmd160\fR"
.IX Item "\fBsha\fR "
.IX Item "\fBsha1\fR "
.IX Subsection "\s-1ENCODING\s0 \s-1AND\s0 \s-1CIPHER\s0 \s-1COMMANDS\s0"
.IX Item "\fBbase64\fR"
.IX Item "\fBbf bf-cbc bf-cfb bf-ecb bf-ofb\fR"
.IX Item "\fBcast cast-cbc\fR"
.IX Item "\fBcast5-cbc cast5-cfb cast5-ecb cast5-ofb\fR"
.IX Item "\fBdes des-cbc des-cfb des-ecb des-ede des-ede-cbc des-ede-cfb des-ede-ofb des-ofb\fR"
.IX Item "\fBdes3 desx des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb\fR"
.IX Item "\fBidea idea-cbc idea-cfb idea-ecb idea-ofb\fR"
.IX Item "\fBrc2 rc2-cbc rc2-cfb rc2-ecb rc2-ofb\fR"
.IX Item "\fBrc4\fR"
.IX Item "\fBrc5 rc5-cbc rc5-cfb rc5-ecb rc5-ofb\fR"
.IX Header "PASS PHRASE ARGUMENTS"
.IX Item "\fBpass:password\fR"
.IX Item "\fBenv:var\fR"
.IX Item "\fBfile:pathname\fR"
.IX Item "\fBfd:number\fR"
.IX Item "\fBstdin\fR"
.IX Header "SEE ALSO"
.IX Header "HISTORY"