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