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