Merge from vendor branch LIBARCHIVE:
[dragonfly.git] / secure / usr.bin / openssl / man / openssl.1
1 .\" Automatically generated by Pod::Man 2.12 (Pod::Simple 3.05)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sh \" Subsection heading
6 .br
7 .if t .Sp
8 .ne 5
9 .PP
10 \fB\\$1\fR
11 .PP
12 ..
13 .de Sp \" Vertical space (when we can't use .PP)
14 .if t .sp .5v
15 .if n .sp
16 ..
17 .de Vb \" Begin verbatim text
18 .ft CW
19 .nf
20 .ne \\$1
21 ..
22 .de Ve \" End verbatim text
23 .ft R
24 .fi
25 ..
26 .\" Set up some character translations and predefined strings.  \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
29 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
30 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
31 .\" nothing in troff, for use with C<>.
32 .tr \(*W-
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34 .ie n \{\
35 .    ds -- \(*W-
36 .    ds PI pi
37 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
39 .    ds L" ""
40 .    ds R" ""
41 .    ds C` ""
42 .    ds C' ""
43 'br\}
44 .el\{\
45 .    ds -- \|\(em\|
46 .    ds PI \(*p
47 .    ds L" ``
48 .    ds R" ''
49 'br\}
50 .\"
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD.  Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
55 .if \nF \{\
56 .    de IX
57 .    tm Index:\\$1\t\\n%\t"\\$2"
58 ..
59 .    nr % 0
60 .    rr F
61 .\}
62 .\"
63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
65 .    \" fudge factors for nroff and troff
66 .if n \{\
67 .    ds #H 0
68 .    ds #V .8m
69 .    ds #F .3m
70 .    ds #[ \f1
71 .    ds #] \fP
72 .\}
73 .if t \{\
74 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
75 .    ds #V .6m
76 .    ds #F 0
77 .    ds #[ \&
78 .    ds #] \&
79 .\}
80 .    \" simple accents for nroff and troff
81 .if n \{\
82 .    ds ' \&
83 .    ds ` \&
84 .    ds ^ \&
85 .    ds , \&
86 .    ds ~ ~
87 .    ds /
88 .\}
89 .if t \{\
90 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
96 .\}
97 .    \" troff and (daisy-wheel) nroff accents
98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105 .ds ae a\h'-(\w'a'u*4/10)'e
106 .ds Ae A\h'-(\w'A'u*4/10)'E
107 .    \" corrections for vroff
108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
110 .    \" for low resolution devices (crt and lpr)
111 .if \n(.H>23 .if \n(.V>19 \
112 \{\
113 .    ds : e
114 .    ds 8 ss
115 .    ds o a
116 .    ds d- d\h'-1'\(ga
117 .    ds D- D\h'-1'\(hy
118 .    ds th \o'bp'
119 .    ds Th \o'LP'
120 .    ds ae ae
121 .    ds Ae AE
122 .\}
123 .rm #[ #] #H #V #F C
124 .\" ========================================================================
125 .\"
126 .IX Title "OPENSSL 1"
127 .TH OPENSSL 1 "2007-10-24" "0.9.8g" "OpenSSL"
128 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
129 .\" way too many mistakes in technical documents.
130 .if n .ad l
131 .nh
132 .SH "NAME"
133 openssl \- OpenSSL command line tool
134 .SH "SYNOPSIS"
135 .IX Header "SYNOPSIS"
136 \&\fBopenssl\fR
137 \&\fIcommand\fR
138 [ \fIcommand_opts\fR ]
139 [ \fIcommand_args\fR ]
140 .PP
141 \&\fBopenssl\fR [ \fBlist-standard-commands\fR | \fBlist-message-digest-commands\fR | \fBlist-cipher-commands\fR ]
142 .PP
143 \&\fBopenssl\fR \fBno\-\fR\fI\s-1XXX\s0\fR [ \fIarbitrary options\fR ]
144 .SH "DESCRIPTION"
145 .IX Header "DESCRIPTION"
146 OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (\s-1SSL\s0
147 v2/v3) and Transport Layer Security (\s-1TLS\s0 v1) network protocols and related
148 cryptography standards required by them.
149 .PP
150 The \fBopenssl\fR program is a command line tool for using the various
151 cryptography functions of OpenSSL's \fBcrypto\fR library from the shell. 
152 It can be used for
153 .PP
154 .Vb 6
155 \& o  Creation of RSA, DH and DSA key parameters
156 \& o  Creation of X.509 certificates, CSRs and CRLs 
157 \& o  Calculation of Message Digests
158 \& o  Encryption and Decryption with Ciphers
159 \& o  SSL/TLS Client and Server Tests
160 \& o  Handling of S/MIME signed or encrypted mail
161 .Ve
162 .SH "COMMAND SUMMARY"
163 .IX Header "COMMAND SUMMARY"
164 The \fBopenssl\fR program provides a rich variety of commands (\fIcommand\fR in the
165 \&\s-1SYNOPSIS\s0 above), each of which often has a wealth of options and arguments
166 (\fIcommand_opts\fR and \fIcommand_args\fR in the \s-1SYNOPSIS\s0).
167 .PP
168 The pseudo-commands \fBlist-standard-commands\fR, \fBlist-message-digest-commands\fR,
169 and \fBlist-cipher-commands\fR output a list (one entry per line) of the names
170 of all standard commands, message digest commands, or cipher commands,
171 respectively, that are available in the present \fBopenssl\fR utility.
172 .PP
173 The pseudo-command \fBno\-\fR\fI\s-1XXX\s0\fR tests whether a command of the
174 specified name is available.  If no command named \fI\s-1XXX\s0\fR exists, it
175 returns 0 (success) and prints \fBno\-\fR\fI\s-1XXX\s0\fR; otherwise it returns 1
176 and prints \fI\s-1XXX\s0\fR.  In both cases, the output goes to \fBstdout\fR and
177 nothing is printed to \fBstderr\fR.  Additional command line arguments
178 are always ignored.  Since for each cipher there is a command of the
179 same name, this provides an easy way for shell scripts to test for the
180 availability of ciphers in the \fBopenssl\fR program.  (\fBno\-\fR\fI\s-1XXX\s0\fR is
181 not able to detect pseudo-commands such as \fBquit\fR,
182 \&\fBlist\-\fR\fI...\fR\fB\-commands\fR, or \fBno\-\fR\fI\s-1XXX\s0\fR itself.)
183 .Sh "\s-1STANDARD\s0 \s-1COMMANDS\s0"
184 .IX Subsection "STANDARD COMMANDS"
185 .IP "\fBasn1parse\fR" 10
186 .IX Item "asn1parse"
187 Parse an \s-1ASN\s0.1 sequence.
188 .IP "\fBca\fR" 10
189 .IX Item "ca"
190 Certificate Authority (\s-1CA\s0) Management.
191 .IP "\fBciphers\fR" 10
192 .IX Item "ciphers"
193 Cipher Suite Description Determination.
194 .IP "\fBcrl\fR" 10
195 .IX Item "crl"
196 Certificate Revocation List (\s-1CRL\s0) Management.
197 .IP "\fBcrl2pkcs7\fR" 10
198 .IX Item "crl2pkcs7"
199 \&\s-1CRL\s0 to PKCS#7 Conversion.
200 .IP "\fBdgst\fR" 10
201 .IX Item "dgst"
202 Message Digest Calculation.
203 .IP "\fBdh\fR" 10
204 .IX Item "dh"
205 Diffie-Hellman Parameter Management.
206 Obsoleted by \fBdhparam\fR.
207 .IP "\fBdsa\fR" 10
208 .IX Item "dsa"
209 \&\s-1DSA\s0 Data Management.
210 .IP "\fBdsaparam\fR" 10
211 .IX Item "dsaparam"
212 \&\s-1DSA\s0 Parameter Generation.
213 .IP "\fBenc\fR" 10
214 .IX Item "enc"
215 Encoding with Ciphers.
216 .IP "\fBerrstr\fR" 10
217 .IX Item "errstr"
218 Error Number to Error String Conversion.
219 .IP "\fBdhparam\fR" 10
220 .IX Item "dhparam"
221 Generation and Management of Diffie-Hellman Parameters.
222 .IP "\fBgendh\fR" 10
223 .IX Item "gendh"
224 Generation of Diffie-Hellman Parameters.
225 Obsoleted by \fBdhparam\fR.
226 .IP "\fBgendsa\fR" 10
227 .IX Item "gendsa"
228 Generation of \s-1DSA\s0 Parameters.
229 .IP "\fBgenrsa\fR" 10
230 .IX Item "genrsa"
231 Generation of \s-1RSA\s0 Parameters.
232 .IP "\fBocsp\fR" 10
233 .IX Item "ocsp"
234 Online Certificate Status Protocol utility.
235 .IP "\fBpasswd\fR" 10
236 .IX Item "passwd"
237 Generation of hashed passwords.
238 .IP "\fBpkcs12\fR" 10
239 .IX Item "pkcs12"
240 PKCS#12 Data Management.
241 .IP "\fBpkcs7\fR" 10
242 .IX Item "pkcs7"
243 PKCS#7 Data Management.
244 .IP "\fBrand\fR" 10
245 .IX Item "rand"
246 Generate pseudo-random bytes.
247 .IP "\fBreq\fR" 10
248 .IX Item "req"
249 X.509 Certificate Signing Request (\s-1CSR\s0) Management.
250 .IP "\fBrsa\fR" 10
251 .IX Item "rsa"
252 \&\s-1RSA\s0 Data Management.
253 .IP "\fBrsautl\fR" 10
254 .IX Item "rsautl"
255 \&\s-1RSA\s0 utility for signing, verification, encryption, and decryption.
256 .IP "\fBs_client\fR" 10
257 .IX Item "s_client"
258 This implements a generic \s-1SSL/TLS\s0 client which can establish a transparent
259 connection to a remote server speaking \s-1SSL/TLS\s0. It's intended for testing
260 purposes only and provides only rudimentary interface functionality but
261 internally uses mostly all functionality of the OpenSSL \fBssl\fR library.
262 .IP "\fBs_server\fR" 10
263 .IX Item "s_server"
264 This implements a generic \s-1SSL/TLS\s0 server which accepts connections from remote
265 clients speaking \s-1SSL/TLS\s0. It's intended for testing purposes only and provides
266 only rudimentary interface functionality but internally uses mostly all
267 functionality of the OpenSSL \fBssl\fR library.  It provides both an own command
268 line oriented protocol for testing \s-1SSL\s0 functions and a simple \s-1HTTP\s0 response
269 facility to emulate an SSL/TLS\-aware webserver.
270 .IP "\fBs_time\fR" 10
271 .IX Item "s_time"
272 \&\s-1SSL\s0 Connection Timer.
273 .IP "\fBsess_id\fR" 10
274 .IX Item "sess_id"
275 \&\s-1SSL\s0 Session Data Management.
276 .IP "\fBsmime\fR" 10
277 .IX Item "smime"
278 S/MIME mail processing.
279 .IP "\fBspeed\fR" 10
280 .IX Item "speed"
281 Algorithm Speed Measurement.
282 .IP "\fBverify\fR" 10
283 .IX Item "verify"
284 X.509 Certificate Verification.
285 .IP "\fBversion\fR" 10
286 .IX Item "version"
287 OpenSSL Version Information.
288 .IP "\fBx509\fR" 10
289 .IX Item "x509"
290 X.509 Certificate Data Management.
291 .Sh "\s-1MESSAGE\s0 \s-1DIGEST\s0 \s-1COMMANDS\s0"
292 .IX Subsection "MESSAGE DIGEST COMMANDS"
293 .IP "\fBmd2\fR" 10
294 .IX Item "md2"
295 \&\s-1MD2\s0 Digest
296 .IP "\fBmd5\fR" 10
297 .IX Item "md5"
298 \&\s-1MD5\s0 Digest
299 .IP "\fBmdc2\fR" 10
300 .IX Item "mdc2"
301 \&\s-1MDC2\s0 Digest
302 .IP "\fBrmd160\fR" 10
303 .IX Item "rmd160"
304 \&\s-1RMD\-160\s0 Digest
305 .IP "\fBsha\fR" 10
306 .IX Item "sha"
307 \&\s-1SHA\s0 Digest
308 .IP "\fBsha1\fR" 10
309 .IX Item "sha1"
310 \&\s-1SHA\-1\s0 Digest
311 .IP "\fBsha224\fR" 10
312 .IX Item "sha224"
313 \&\s-1SHA\-224\s0 Digest
314 .IP "\fBsha256\fR" 10
315 .IX Item "sha256"
316 \&\s-1SHA\-256\s0 Digest
317 .IP "\fBsha384\fR" 10
318 .IX Item "sha384"
319 \&\s-1SHA\-384\s0 Digest
320 .IP "\fBsha512\fR" 10
321 .IX Item "sha512"
322 \&\s-1SHA\-512\s0 Digest
323 .Sh "\s-1ENCODING\s0 \s-1AND\s0 \s-1CIPHER\s0 \s-1COMMANDS\s0"
324 .IX Subsection "ENCODING AND CIPHER COMMANDS"
325 .IP "\fBbase64\fR" 10
326 .IX Item "base64"
327 Base64 Encoding
328 .IP "\fBbf bf-cbc bf-cfb bf-ecb bf-ofb\fR" 10
329 .IX Item "bf bf-cbc bf-cfb bf-ecb bf-ofb"
330 Blowfish Cipher
331 .IP "\fBcast cast-cbc\fR" 10
332 .IX Item "cast cast-cbc"
333 \&\s-1CAST\s0 Cipher
334 .IP "\fBcast5\-cbc cast5\-cfb cast5\-ecb cast5\-ofb\fR" 10
335 .IX Item "cast5-cbc cast5-cfb cast5-ecb cast5-ofb"
336 \&\s-1CAST5\s0 Cipher
337 .IP "\fBdes des-cbc des-cfb des-ecb des-ede des-ede-cbc des-ede-cfb des-ede-ofb des-ofb\fR" 10
338 .IX Item "des des-cbc des-cfb des-ecb des-ede des-ede-cbc des-ede-cfb des-ede-ofb des-ofb"
339 \&\s-1DES\s0 Cipher
340 .IP "\fBdes3 desx des\-ede3 des\-ede3\-cbc des\-ede3\-cfb des\-ede3\-ofb\fR" 10
341 .IX Item "des3 desx des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb"
342 Triple-DES Cipher
343 .IP "\fBidea idea-cbc idea-cfb idea-ecb idea-ofb\fR" 10
344 .IX Item "idea idea-cbc idea-cfb idea-ecb idea-ofb"
345 \&\s-1IDEA\s0 Cipher
346 .IP "\fBrc2 rc2\-cbc rc2\-cfb rc2\-ecb rc2\-ofb\fR" 10
347 .IX Item "rc2 rc2-cbc rc2-cfb rc2-ecb rc2-ofb"
348 \&\s-1RC2\s0 Cipher
349 .IP "\fBrc4\fR" 10
350 .IX Item "rc4"
351 \&\s-1RC4\s0 Cipher
352 .IP "\fBrc5 rc5\-cbc rc5\-cfb rc5\-ecb rc5\-ofb\fR" 10
353 .IX Item "rc5 rc5-cbc rc5-cfb rc5-ecb rc5-ofb"
354 \&\s-1RC5\s0 Cipher
355 .SH "PASS PHRASE ARGUMENTS"
356 .IX Header "PASS PHRASE ARGUMENTS"
357 Several commands accept password arguments, typically using \fB\-passin\fR
358 and \fB\-passout\fR for input and output passwords respectively. These allow
359 the password to be obtained from a variety of sources. Both of these
360 options take a single argument whose format is described below. If no
361 password argument is given and a password is required then the user is
362 prompted to enter one: this will typically be read from the current
363 terminal with echoing turned off.
364 .IP "\fBpass:password\fR" 10
365 .IX Item "pass:password"
366 the actual password is \fBpassword\fR. Since the password is visible
367 to utilities (like 'ps' under Unix) this form should only be used
368 where security is not important.
369 .IP "\fBenv:var\fR" 10
370 .IX Item "env:var"
371 obtain the password from the environment variable \fBvar\fR. Since
372 the environment of other processes is visible on certain platforms
373 (e.g. ps under certain Unix OSes) this option should be used with caution.
374 .IP "\fBfile:pathname\fR" 10
375 .IX Item "file:pathname"
376 the first line of \fBpathname\fR is the password. If the same \fBpathname\fR
377 argument is supplied to \fB\-passin\fR and \fB\-passout\fR arguments then the first
378 line will be used for the input password and the next line for the output
379 password. \fBpathname\fR need not refer to a regular file: it could for example
380 refer to a device or named pipe.
381 .IP "\fBfd:number\fR" 10
382 .IX Item "fd:number"
383 read the password from the file descriptor \fBnumber\fR. This can be used to
384 send the data via a pipe for example.
385 .IP "\fBstdin\fR" 10
386 .IX Item "stdin"
387 read the password from standard input.
388 .SH "SEE ALSO"
389 .IX Header "SEE ALSO"
390 \&\fIasn1parse\fR\|(1), \fIca\fR\|(1), \fIconfig\fR\|(5),
391 \&\fIcrl\fR\|(1), \fIcrl2pkcs7\fR\|(1), \fIdgst\fR\|(1),
392 \&\fIdhparam\fR\|(1), \fIdsa\fR\|(1), \fIdsaparam\fR\|(1),
393 \&\fIenc\fR\|(1), \fIgendsa\fR\|(1),
394 \&\fIgenrsa\fR\|(1), \fInseq\fR\|(1), \fIopenssl\fR\|(1),
395 \&\fIpasswd\fR\|(1),
396 \&\fIpkcs12\fR\|(1), \fIpkcs7\fR\|(1), \fIpkcs8\fR\|(1),
397 \&\fIrand\fR\|(1), \fIreq\fR\|(1), \fIrsa\fR\|(1),
398 \&\fIrsautl\fR\|(1), \fIs_client\fR\|(1),
399 \&\fIs_server\fR\|(1), \fIs_time\fR\|(1),
400 \&\fIsmime\fR\|(1), \fIspkac\fR\|(1),
401 \&\fIverify\fR\|(1), \fIversion\fR\|(1), \fIx509\fR\|(1),
402 \&\fIcrypto\fR\|(3), \fIssl\fR\|(3)
403 .SH "HISTORY"
404 .IX Header "HISTORY"
405 The \fIopenssl\fR\|(1) document appeared in OpenSSL 0.9.2.
406 The \fBlist\-\fR\fI\s-1XXX\s0\fR\fB\-commands\fR pseudo-commands were added in OpenSSL 0.9.3;
407 the \fBno\-\fR\fI\s-1XXX\s0\fR pseudo-commands were added in OpenSSL 0.9.5a.
408 For notes on the availability of other commands, see their individual
409 manual pages.