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