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