Document pseudo-commands.
[oweals/openssl.git] / doc / apps / openssl.pod
1
2 =pod
3
4 =head1 NAME
5
6 openssl - OpenSSL command line tool
7
8 =head1 SYNOPSIS
9
10 B<openssl>
11 I<command>
12 [ I<command_opts> ]
13 [ I<command_args> ]
14
15 B<openssl> [ B<list-standard-commands> | B<list-message-digest-commands> | B<list-cipher-commands> ]
16
17 B<openssl> B<no->I<XXX> [ I<arbitrary options> ]
18
19 =head1 DESCRIPTION
20
21 OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL
22 v2/v3) and Transport Layer Security (TLS v1) network protocols and related
23 cryptography standards required by them.
24
25 The B<openssl> program is a command line tool for using the various
26 cryptography functions of OpenSSL's B<crypto> library from the shell. 
27 It can be used for 
28
29  o  Creation of RSA, DH and DSA key parameters
30  o  Creation of X.509 certificates, CSRs and CRLs 
31  o  Calculation of Message Digests
32  o  Encryption and Decryption with Ciphers
33  o  SSL/TLS Client and Server Tests
34  o  Handling of S/MIME signed or encrypted mail
35
36 =head1 COMMAND SUMMARY
37
38 The B<openssl> program provides a rich variety of commands (I<command> in the
39 SYNOPSIS above), each of which often has a wealth of options and arguments
40 (I<command_opts> and I<command_args> in the SYNOPSIS).
41
42 The pseudo-commands B<list-standard-commands>, B<list-message-digest-commands>,
43 and B<list-cipher-commands> output a list (one entry per line) of the names
44 of all standard commands, message digest commands, or cipher commands,
45 respectively, that are available in the present B<openssl> utility.
46
47 The pseudo-command B<no->I<XXX> tests whether a command of the
48 specified name is available.  If no command named I<XXX> exists, it
49 returns 0 (success) and prints B<no->I<XXX>; otherwise it returns 1
50 and prints I<XXX>.  In both cases, the output goes to B<stdout> and
51 nothing is printed to B<stderr>.  Additional command line arguments
52 are always ignored.  Since for each cipher there is a command of the
53 same name, this provides an easy way for shell scripts to test for the
54 availability of ciphers in the B<openssl> program.  (B<no->I<XXX> is
55 not able to detect pseudo-commands such as B<quit>,
56 B<list->I<...>B<-commands>, or B<no->I<XXX> itself.)
57
58 =head2 STANDARD COMMANDS
59
60 =over 10
61
62 =item L<B<asn1parse>|asn1parse(1)>
63
64 Parse an ASN.1 sequence.
65
66 =item L<B<ca>|ca(1)>
67
68 Certificate Authority (CA) Management.  
69
70 =item L<B<ciphers>|ciphers(1)>
71
72 Cipher Suite Description Determination.
73
74 =item L<B<crl>|crl(1)>
75
76 Certificate Revocation List (CRL) Management.
77
78 =item L<B<crl2pkcs7>|crl2pkcs7(1)>
79
80 CRL to PKCS#7 Conversion.
81
82 =item L<B<dgst>|dgst(1)>
83
84 Message Digest Calculation.
85
86 =item L<B<dh>|dh(1)>
87
88 Diffie-Hellman Data Management.
89
90 =item L<B<dsa>|dsa(1)>
91
92 DSA Data Management.
93
94 =item L<B<dsaparam>|dsaparam(1)>
95
96 DSA Parameter Generation.
97
98 =item L<B<enc>|enc(1)>
99
100 Encoding with Ciphers.
101
102 =item L<B<errstr>|errstr(1)>
103
104 Error Number to Error String Conversion.
105
106 =item L<B<gendh>|gendh(1)>
107
108 Generation of Diffie-Hellman Parameters.
109
110 =item L<B<gendsa>|gendsa(1)>
111
112 Generation of DSA Parameters.
113
114 =item L<B<genrsa>|genrsa(1)>
115
116 Generation of RSA Parameters.
117
118 =item L<B<passwd>|passwd(1)>
119
120 Generation of hashed passwords.
121
122 =item L<B<pkcs7>|pkcs7(1)>
123
124 PKCS#7 Data Management.
125
126 =item L<B<rand>|rand(1)>
127
128 Generate pseudo-random bytes.
129
130 =item L<B<req>|req(1)>
131
132 X.509 Certificate Signing Request (CSR) Management.
133
134 =item L<B<rsa>|rsa(1)>
135
136 RSA Data Management.
137
138 =item L<B<s_client>|s_client(1)>
139
140 This implements a generic SSL/TLS client which can establish a transparent
141 connection to a remote server speaking SSL/TLS. It's intended for testing
142 purposes only and provides only rudimentary interface functionality but
143 internally uses mostly all functionality of the OpenSSL B<ssl> library.
144
145 =item L<B<s_server>|s_server(1)>
146
147 This implements a generic SSL/TLS server which accepts connections from remote
148 clients speaking SSL/TLS. It's intended for testing purposes only and provides
149 only rudimentary interface functionality but internally uses mostly all
150 functionality of the OpenSSL B<ssl> library.  It provides both an own command
151 line oriented protocol for testing SSL functions and a simple HTTP response
152 facility to emulate an SSL/TLS-aware webserver.
153
154 =item L<B<s_time>|s_time(1)>
155
156 SSL Connection Timer.
157
158 =item L<B<sess_id>|sess_id(1)>
159
160 SSL Session Data Management.
161
162 =item L<B<smime>|smime(1)>
163
164 S/MIME mail processing.
165
166 =item L<B<speed>|speed(1)>
167
168 Algorithm Speed Measurement.
169
170 =item L<B<verify>|verify(1)>
171
172 X.509 Certificate Verification.
173
174 =item L<B<version>|version(1)>
175
176 OpenSSL Version Information.
177
178 =item L<B<x509>|x509(1)>
179
180 X.509 Certificate Data Management.
181
182 =back
183
184 =head2 MESSAGE DIGEST COMMANDS
185
186 =over 10
187
188 =item B<md2>
189
190 MD2 Digest
191
192 =item B<md5>
193
194 MD5 Digest
195
196 =item B<mdc2>
197
198 MDC2 Digest
199
200 =item B<rmd160>
201
202 RMD-160 Digest
203
204 =item B<sha>            
205
206 SHA Digest
207
208 =item B<sha1>           
209
210 SHA-1 Digest
211
212 =back
213
214 =head2 ENCODING AND CIPHER COMMANDS
215
216 =over 10
217
218 =item B<base64>
219
220 Base64 Encoding
221
222 =item B<bf bf-cbc bf-cfb bf-ecb bf-ofb>
223
224 Blowfish Cipher
225
226 =item B<cast cast-cbc>
227
228 CAST Cipher
229
230 =item B<cast5-cbc cast5-cfb cast5-ecb cast5-ofb>
231
232 CAST5 Cipher
233
234 =item B<des des-cbc des-cfb des-ecb des-ede des-ede-cbc des-ede-cfb des-ede-ofb des-ofb>
235
236 DES Cipher
237
238 =item B<des3 desx des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb>
239
240 Triple-DES Cipher
241
242 =item B<idea idea-cbc idea-cfb idea-ecb idea-ofb>
243
244 IDEA Cipher
245
246 =item B<rc2 rc2-cbc rc2-cfb rc2-ecb rc2-ofb>
247
248 RC2 Cipher
249
250 =item B<rc4>
251
252 RC4 Cipher
253
254 =item B<rc5 rc5-cbc rc5-cfb rc5-ecb rc5-ofb>
255
256 RC5 Cipher
257
258 =back
259
260 =head1 PASS PHRASE ARGUMENTS
261
262 Several commands accept password arguments, typically using B<-passin>
263 and B<-passout> for input and output passwords respectively. These allow
264 the password to be obtained from a variety of sources. Both of these
265 options take a single argument whose format is described below. If no
266 password argument is given and a password is required then the user is
267 prompted to enter one: this will typically be read from the current
268 terminal with echoing turned off.
269
270 =over 10
271
272 =item B<pass:password>
273
274 the actual password is B<password>. Since the password is visible
275 to utilities (like 'ps' under Unix) this form should only be used
276 where security is not important.
277
278 =item B<env:var>
279
280 obtain the password from the environment variable B<var>. Since
281 the environment of other processes is visible on certain platforms
282 (e.g. ps under certain Unix OSes) this option should be used with caution.
283
284 =item B<file:pathname>
285
286 the first line of B<pathname> is the password. If the same B<pathname>
287 argument is supplied to B<-passin> and B<-passout> arguments then the first
288 line will be used for the input password and the next line for the output
289 password. B<pathname> need not refer to a regular file: it could for example
290 refer to a device or named pipe.
291
292 =item B<fd:number>
293
294 read the password from the file descriptor B<number>. This can be used to
295 send the data via a pipe for example.
296
297 =item B<stdin>
298
299 read the password from standard input.
300
301 =back
302
303 =head1 SEE ALSO
304
305 L<asn1parse(1)|asn1parse(1)>, L<ca(1)|ca(1)>, L<config(5)|config(5)>,
306 L<crl(1)|crl(1)>, L<crl2pkcs7(1)|crl2pkcs7(1)>, L<dgst(1)|dgst(1)>,
307 L<dhparam(1)|dhparam(1)>, L<dsa(1)|dsa(1)>, L<dsaparam(1)|dsaparam(1)>,
308 L<enc(1)|enc(1)>, L<gendsa(1)|gendsa(1)>,
309 L<genrsa(1)|genrsa(1)>, L<nseq(1)|nseq(1)>, L<openssl(1)|openssl(1)>,
310 L<passwd(1)|passwd(1)>,
311 L<pkcs12(1)|pkcs12(1)>, L<pkcs7(1)|pkcs7(1)>, L<pkcs8(1)|pkcs8(1)>,
312 L<rand(1)|rand(1)>, L<req(1)|req(1)>, L<rsa(1)|rsa(1)>, L<s_client(1)|s_client(1)>,
313 L<s_server(1)|s_server(1)>, L<smime(1)|smime(1)>, L<spkac(1)|spkac(1)>,
314 L<verify(1)|verify(1)>, L<version(1)|version(1)>, L<x509(1)|x509(1)>,
315 L<crypto(3)|crypto(3)>, L<ssl(3)|ssl(3)> 
316
317 =head1 HISTORY
318
319 The openssl(1) document appeared in OpenSSL 0.9.2.
320 The B<list->I<XXX>B<-commands> pseudo-commands were added in OpenSSL 0.9.3;
321 the B<no->I<XXX> pseudo-commands were added in OpenSSL 0.9.5a.
322 For notes on the availability of other commands, see their individual
323 manual pages.
324
325 =cut