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