xref: /freebsd/crypto/openssl/doc/man1/openssl.pod (revision dacc43df34a7da82747af82be62cb645eb36f6ca)
1=pod
2
3=head1 NAME
4
5openssl - OpenSSL command line tool
6
7=head1 SYNOPSIS
8
9B<openssl>
10I<command>
11[ I<command_opts> ]
12[ I<command_args> ]
13
14B<openssl> B<list> [ B<standard-commands> | B<digest-commands> | B<cipher-commands> | B<cipher-algorithms> | B<digest-algorithms> | B<public-key-algorithms>]
15
16B<openssl> B<no->I<XXX> [ I<arbitrary options> ]
17
18=head1 DESCRIPTION
19
20OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL
21v2/v3) and Transport Layer Security (TLS v1) network protocols and related
22cryptography standards required by them.
23
24The B<openssl> program is a command line tool for using the various
25cryptography functions of OpenSSL's B<crypto> library from the shell.
26It can be used for
27
28 o  Creation and management of private keys, public keys and parameters
29 o  Public key cryptographic operations
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
39The B<openssl> program provides a rich variety of commands (I<command> in the
40SYNOPSIS above), each of which often has a wealth of options and arguments
41(I<command_opts> and I<command_args> in the SYNOPSIS).
42
43Many commands use an external configuration file for some or all of their
44arguments and have a B<-config> option to specify that file.
45The environment variable B<OPENSSL_CONF> can be used to specify
46the location of the file.
47If the environment variable is not specified, then the file is named
48B<openssl.cnf> in the default certificate storage area, whose value
49depends on the configuration flags specified when the OpenSSL
50was built.
51
52The list parameters B<standard-commands>, B<digest-commands>,
53and B<cipher-commands> output a list (one entry per line) of the names
54of all standard commands, message digest commands, or cipher commands,
55respectively, that are available in the present B<openssl> utility.
56
57The list parameters B<cipher-algorithms> and
58B<digest-algorithms> list all cipher and message digest names, one entry per line. Aliases are listed as:
59
60 from => to
61
62The list parameter B<public-key-algorithms> lists all supported public
63key algorithms.
64
65The command B<no->I<XXX> tests whether a command of the
66specified name is available.  If no command named I<XXX> exists, it
67returns 0 (success) and prints B<no->I<XXX>; otherwise it returns 1
68and prints I<XXX>.  In both cases, the output goes to B<stdout> and
69nothing is printed to B<stderr>.  Additional command line arguments
70are always ignored.  Since for each cipher there is a command of the
71same name, this provides an easy way for shell scripts to test for the
72availability of ciphers in the B<openssl> program.  (B<no->I<XXX> is
73not able to detect pseudo-commands such as B<quit>,
74B<list>, or B<no->I<XXX> itself.)
75
76=head2 Standard Commands
77
78=over 4
79
80=item B<asn1parse>
81
82Parse an ASN.1 sequence.
83
84=item B<ca>
85
86Certificate Authority (CA) Management.
87
88=item B<ciphers>
89
90Cipher Suite Description Determination.
91
92=item B<cms>
93
94CMS (Cryptographic Message Syntax) utility.
95
96=item B<crl>
97
98Certificate Revocation List (CRL) Management.
99
100=item B<crl2pkcs7>
101
102CRL to PKCS#7 Conversion.
103
104=item B<dgst>
105
106Message Digest Calculation.
107
108=item B<dh>
109
110Diffie-Hellman Parameter Management.
111Obsoleted by L<dhparam(1)>.
112
113=item B<dhparam>
114
115Generation and Management of Diffie-Hellman Parameters. Superseded by
116L<genpkey(1)> and L<pkeyparam(1)>.
117
118=item B<dsa>
119
120DSA Data Management.
121
122=item B<dsaparam>
123
124DSA Parameter Generation and Management. Superseded by
125L<genpkey(1)> and L<pkeyparam(1)>.
126
127=item B<ec>
128
129EC (Elliptic curve) key processing.
130
131=item B<ecparam>
132
133EC parameter manipulation and generation.
134
135=item B<enc>
136
137Encoding with Ciphers.
138
139=item B<engine>
140
141Engine (loadable module) information and manipulation.
142
143=item B<errstr>
144
145Error Number to Error String Conversion.
146
147=item B<gendh>
148
149Generation of Diffie-Hellman Parameters.
150Obsoleted by L<dhparam(1)>.
151
152=item B<gendsa>
153
154Generation of DSA Private Key from Parameters. Superseded by
155L<genpkey(1)> and L<pkey(1)>.
156
157=item B<genpkey>
158
159Generation of Private Key or Parameters.
160
161=item B<genrsa>
162
163Generation of RSA Private Key. Superseded by L<genpkey(1)>.
164
165=item B<nseq>
166
167Create or examine a Netscape certificate sequence.
168
169=item B<ocsp>
170
171Online Certificate Status Protocol utility.
172
173=item B<passwd>
174
175Generation of hashed passwords.
176
177=item B<pkcs12>
178
179PKCS#12 Data Management.
180
181=item B<pkcs7>
182
183PKCS#7 Data Management.
184
185=item B<pkcs8>
186
187PKCS#8 format private key conversion tool.
188
189=item B<pkey>
190
191Public and private key management.
192
193=item B<pkeyparam>
194
195Public key algorithm parameter management.
196
197=item B<pkeyutl>
198
199Public key algorithm cryptographic operation utility.
200
201=item B<prime>
202
203Compute prime numbers.
204
205=item B<rand>
206
207Generate pseudo-random bytes.
208
209=item B<rehash>
210
211Create symbolic links to certificate and CRL files named by the hash values.
212
213=item B<req>
214
215PKCS#10 X.509 Certificate Signing Request (CSR) Management.
216
217=item B<rsa>
218
219RSA key management.
220
221=item B<rsautl>
222
223RSA utility for signing, verification, encryption, and decryption. Superseded
224by  L<pkeyutl(1)>.
225
226=item B<s_client>
227
228This implements a generic SSL/TLS client which can establish a transparent
229connection to a remote server speaking SSL/TLS. It's intended for testing
230purposes only and provides only rudimentary interface functionality but
231internally uses mostly all functionality of the OpenSSL B<ssl> library.
232
233=item B<s_server>
234
235This implements a generic SSL/TLS server which accepts connections from remote
236clients speaking SSL/TLS. It's intended for testing purposes only and provides
237only rudimentary interface functionality but internally uses mostly all
238functionality of the OpenSSL B<ssl> library.  It provides both an own command
239line oriented protocol for testing SSL functions and a simple HTTP response
240facility to emulate an SSL/TLS-aware webserver.
241
242=item B<s_time>
243
244SSL Connection Timer.
245
246=item B<sess_id>
247
248SSL Session Data Management.
249
250=item B<smime>
251
252S/MIME mail processing.
253
254=item B<speed>
255
256Algorithm Speed Measurement.
257
258=item B<spkac>
259
260SPKAC printing and generating utility.
261
262=item B<srp>
263
264Maintain SRP password file.
265
266=item B<storeutl>
267
268Utility to list and display certificates, keys, CRLs, etc.
269
270=item B<ts>
271
272Time Stamping Authority tool (client/server).
273
274=item B<verify>
275
276X.509 Certificate Verification.
277
278=item B<version>
279
280OpenSSL Version Information.
281
282=item B<x509>
283
284X.509 Certificate Data Management.
285
286=back
287
288=head2 Message Digest Commands
289
290=over 4
291
292=item B<blake2b512>
293
294BLAKE2b-512 Digest
295
296=item B<blake2s256>
297
298BLAKE2s-256 Digest
299
300=item B<md2>
301
302MD2 Digest
303
304=item B<md4>
305
306MD4 Digest
307
308=item B<md5>
309
310MD5 Digest
311
312=item B<mdc2>
313
314MDC2 Digest
315
316=item B<rmd160>
317
318RMD-160 Digest
319
320=item B<sha1>
321
322SHA-1 Digest
323
324=item B<sha224>
325
326SHA-2 224 Digest
327
328=item B<sha256>
329
330SHA-2 256 Digest
331
332=item B<sha384>
333
334SHA-2 384 Digest
335
336=item B<sha512>
337
338SHA-2 512 Digest
339
340=item B<sha3-224>
341
342SHA-3 224 Digest
343
344=item B<sha3-256>
345
346SHA-3 256 Digest
347
348=item B<sha3-384>
349
350SHA-3 384 Digest
351
352=item B<sha3-512>
353
354SHA-3 512 Digest
355
356=item B<shake128>
357
358SHA-3 SHAKE128 Digest
359
360=item B<shake256>
361
362SHA-3 SHAKE256 Digest
363
364=item B<sm3>
365
366SM3 Digest
367
368=back
369
370=head2 Encoding and Cipher Commands
371
372=over 4
373
374=item B<base64>
375
376Base64 Encoding
377
378=item B<bf>, B<bf-cbc>, B<bf-cfb>, B<bf-ecb>, B<bf-ofb>
379
380Blowfish Cipher
381
382=item B<cast>, B<cast-cbc>
383
384CAST Cipher
385
386=item B<cast5-cbc>, B<cast5-cfb>, B<cast5-ecb>, B<cast5-ofb>
387
388CAST5 Cipher
389
390=item B<des>, B<des-cbc>, B<des-cfb>, B<des-ecb>, B<des-ede>, B<des-ede-cbc>, B<des-ede-cfb>, B<des-ede-ofb>, B<des-ofb>
391
392DES Cipher
393
394=item B<des3>, B<desx>, B<des-ede3>, B<des-ede3-cbc>, B<des-ede3-cfb>, B<des-ede3-ofb>
395
396Triple-DES Cipher
397
398=item B<idea>, B<idea-cbc>, B<idea-cfb>, B<idea-ecb>, B<idea-ofb>
399
400IDEA Cipher
401
402=item B<rc2>, B<rc2-cbc>, B<rc2-cfb>, B<rc2-ecb>, B<rc2-ofb>
403
404RC2 Cipher
405
406=item B<rc4>
407
408RC4 Cipher
409
410=item B<rc5>, B<rc5-cbc>, B<rc5-cfb>, B<rc5-ecb>, B<rc5-ofb>
411
412RC5 Cipher
413
414=back
415
416=head1 OPTIONS
417
418Details of which options are available depend on the specific command.
419This section describes some common options with common behavior.
420
421=head2 Common Options
422
423=over 4
424
425=item B<-help>
426
427Provides a terse summary of all options.
428
429=back
430
431=head2 Pass Phrase Options
432
433Several commands accept password arguments, typically using B<-passin>
434and B<-passout> for input and output passwords respectively. These allow
435the password to be obtained from a variety of sources. Both of these
436options take a single argument whose format is described below. If no
437password argument is given and a password is required then the user is
438prompted to enter one: this will typically be read from the current
439terminal with echoing turned off.
440
441Note that character encoding may be relevant, please see
442L<passphrase-encoding(7)>.
443
444=over 4
445
446=item B<pass:password>
447
448The actual password is B<password>. Since the password is visible
449to utilities (like 'ps' under Unix) this form should only be used
450where security is not important.
451
452=item B<env:var>
453
454Obtain the password from the environment variable B<var>. Since
455the environment of other processes is visible on certain platforms
456(e.g. ps under certain Unix OSes) this option should be used with caution.
457
458=item B<file:pathname>
459
460The first line of B<pathname> is the password. If the same B<pathname>
461argument is supplied to B<-passin> and B<-passout> arguments then the first
462line will be used for the input password and the next line for the output
463password. B<pathname> need not refer to a regular file: it could for example
464refer to a device or named pipe.
465
466=item B<fd:number>
467
468Read the password from the file descriptor B<number>. This can be used to
469send the data via a pipe for example.
470
471=item B<stdin>
472
473Read the password from standard input.
474
475=back
476
477=head1 SEE ALSO
478
479L<asn1parse(1)>, L<ca(1)>, L<ciphers(1)>, L<cms(1)>, L<config(5)>,
480L<crl(1)>, L<crl2pkcs7(1)>, L<dgst(1)>,
481L<dhparam(1)>, L<dsa(1)>, L<dsaparam(1)>,
482L<ec(1)>, L<ecparam(1)>,
483L<enc(1)>, L<engine(1)>, L<errstr(1)>, L<gendsa(1)>, L<genpkey(1)>,
484L<genrsa(1)>, L<nseq(1)>, L<ocsp(1)>,
485L<passwd(1)>,
486L<pkcs12(1)>, L<pkcs7(1)>, L<pkcs8(1)>,
487L<pkey(1)>, L<pkeyparam(1)>, L<pkeyutl(1)>, L<prime(1)>,
488L<rand(1)>, L<rehash(1)>, L<req(1)>, L<rsa(1)>,
489L<rsautl(1)>, L<s_client(1)>,
490L<s_server(1)>, L<s_time(1)>, L<sess_id(1)>,
491L<smime(1)>, L<speed(1)>, L<spkac(1)>, L<srp(1)>, L<storeutl(1)>,
492L<ts(1)>,
493L<verify(1)>, L<version(1)>, L<x509(1)>,
494L<crypto(7)>, L<ssl(7)>, L<x509v3_config(5)>
495
496=head1 HISTORY
497
498The B<list->I<XXX>B<-algorithms> pseudo-commands were added in OpenSSL 1.0.0;
499For notes on the availability of other commands, see their individual
500manual pages.
501
502=head1 COPYRIGHT
503
504Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
505
506Licensed under the OpenSSL license (the "License").  You may not use
507this file except in compliance with the License.  You can obtain a copy
508in the file LICENSE in the source distribution or at
509L<https://www.openssl.org/source/license.html>.
510
511=cut
512