openssl.pod 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. =pod
  2. =head1 NAME
  3. openssl - OpenSSL command line tool
  4. =head1 SYNOPSIS
  5. B<openssl>
  6. I<command>
  7. [ I<command_opts> ]
  8. [ I<command_args> ]
  9. B<openssl> B<list> [ B<standard-commands> | B<digest-commands> | B<cipher-commands> | B<cipher-algorithms> | B<digest-algorithms> | B<public-key-algorithms>]
  10. B<openssl> B<no->I<XXX> [ I<arbitrary options> ]
  11. =head1 DESCRIPTION
  12. OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL
  13. v2/v3) and Transport Layer Security (TLS v1) network protocols and related
  14. cryptography standards required by them.
  15. The B<openssl> program is a command line tool for using the various
  16. cryptography functions of OpenSSL's B<crypto> library from the shell.
  17. It can be used for
  18. o Creation and management of private keys, public keys and parameters
  19. o Public key cryptographic operations
  20. o Creation of X.509 certificates, CSRs and CRLs
  21. o Calculation of Message Digests
  22. o Encryption and Decryption with Ciphers
  23. o SSL/TLS Client and Server Tests
  24. o Handling of S/MIME signed or encrypted mail
  25. o Time Stamp requests, generation and verification
  26. =head1 COMMAND SUMMARY
  27. The B<openssl> program provides a rich variety of commands (I<command> in the
  28. SYNOPSIS above), each of which often has a wealth of options and arguments
  29. (I<command_opts> and I<command_args> in the SYNOPSIS).
  30. Detailed documentation and use cases for most standard subcommands are available
  31. (e.g., L<x509(1)> or L<openssl-x509(1)>).
  32. Many commands use an external configuration file for some or all of their
  33. arguments and have a B<-config> option to specify that file.
  34. The environment variable B<OPENSSL_CONF> can be used to specify
  35. the location of the file.
  36. If the environment variable is not specified, then the file is named
  37. B<openssl.cnf> in the default certificate storage area, whose value
  38. depends on the configuration flags specified when the OpenSSL
  39. was built.
  40. The list parameters B<standard-commands>, B<digest-commands>,
  41. and B<cipher-commands> output a list (one entry per line) of the names
  42. of all standard commands, message digest commands, or cipher commands,
  43. respectively, that are available in the present B<openssl> utility.
  44. The list parameters B<cipher-algorithms> and
  45. B<digest-algorithms> list all cipher and message digest names, one entry per line. Aliases are listed as:
  46. from => to
  47. The list parameter B<public-key-algorithms> lists all supported public
  48. key algorithms.
  49. The command B<no->I<XXX> tests whether a command of the
  50. specified name is available. If no command named I<XXX> exists, it
  51. returns 0 (success) and prints B<no->I<XXX>; otherwise it returns 1
  52. and prints I<XXX>. In both cases, the output goes to B<stdout> and
  53. nothing is printed to B<stderr>. Additional command line arguments
  54. are always ignored. Since for each cipher there is a command of the
  55. same name, this provides an easy way for shell scripts to test for the
  56. availability of ciphers in the B<openssl> program. (B<no->I<XXX> is
  57. not able to detect pseudo-commands such as B<quit>,
  58. B<list>, or B<no->I<XXX> itself.)
  59. =head2 Standard Commands
  60. =over 4
  61. =item B<asn1parse>
  62. Parse an ASN.1 sequence.
  63. =item B<ca>
  64. Certificate Authority (CA) Management.
  65. =item B<ciphers>
  66. Cipher Suite Description Determination.
  67. =item B<cms>
  68. CMS (Cryptographic Message Syntax) utility.
  69. =item B<crl>
  70. Certificate Revocation List (CRL) Management.
  71. =item B<crl2pkcs7>
  72. CRL to PKCS#7 Conversion.
  73. =item B<dgst>
  74. Message Digest Calculation.
  75. =item B<dh>
  76. Diffie-Hellman Parameter Management.
  77. Obsoleted by L<dhparam(1)>.
  78. =item B<dhparam>
  79. Generation and Management of Diffie-Hellman Parameters. Superseded by
  80. L<genpkey(1)> and L<pkeyparam(1)>.
  81. =item B<dsa>
  82. DSA Data Management.
  83. =item B<dsaparam>
  84. DSA Parameter Generation and Management. Superseded by
  85. L<genpkey(1)> and L<pkeyparam(1)>.
  86. =item B<ec>
  87. EC (Elliptic curve) key processing.
  88. =item B<ecparam>
  89. EC parameter manipulation and generation.
  90. =item B<enc>
  91. Encoding with Ciphers.
  92. =item B<engine>
  93. Engine (loadable module) information and manipulation.
  94. =item B<errstr>
  95. Error Number to Error String Conversion.
  96. =item B<gendh>
  97. Generation of Diffie-Hellman Parameters.
  98. Obsoleted by L<dhparam(1)>.
  99. =item B<gendsa>
  100. Generation of DSA Private Key from Parameters. Superseded by
  101. L<genpkey(1)> and L<pkey(1)>.
  102. =item B<genpkey>
  103. Generation of Private Key or Parameters.
  104. =item B<genrsa>
  105. Generation of RSA Private Key. Superseded by L<genpkey(1)>.
  106. =item B<nseq>
  107. Create or examine a Netscape certificate sequence.
  108. =item B<ocsp>
  109. Online Certificate Status Protocol utility.
  110. =item B<passwd>
  111. Generation of hashed passwords.
  112. =item B<pkcs12>
  113. PKCS#12 Data Management.
  114. =item B<pkcs7>
  115. PKCS#7 Data Management.
  116. =item B<pkcs8>
  117. PKCS#8 format private key conversion tool.
  118. =item B<pkey>
  119. Public and private key management.
  120. =item B<pkeyparam>
  121. Public key algorithm parameter management.
  122. =item B<pkeyutl>
  123. Public key algorithm cryptographic operation utility.
  124. =item B<prime>
  125. Compute prime numbers.
  126. =item B<rand>
  127. Generate pseudo-random bytes.
  128. =item B<rehash>
  129. Create symbolic links to certificate and CRL files named by the hash values.
  130. =item B<req>
  131. PKCS#10 X.509 Certificate Signing Request (CSR) Management.
  132. =item B<rsa>
  133. RSA key management.
  134. =item B<rsautl>
  135. RSA utility for signing, verification, encryption, and decryption. Superseded
  136. by L<pkeyutl(1)>.
  137. =item B<s_client>
  138. This implements a generic SSL/TLS client which can establish a transparent
  139. connection to a remote server speaking SSL/TLS. It's intended for testing
  140. purposes only and provides only rudimentary interface functionality but
  141. internally uses mostly all functionality of the OpenSSL B<ssl> library.
  142. =item B<s_server>
  143. This implements a generic SSL/TLS server which accepts connections from remote
  144. clients speaking SSL/TLS. It's intended for testing purposes only and provides
  145. only rudimentary interface functionality but internally uses mostly all
  146. functionality of the OpenSSL B<ssl> library. It provides both an own command
  147. line oriented protocol for testing SSL functions and a simple HTTP response
  148. facility to emulate an SSL/TLS-aware webserver.
  149. =item B<s_time>
  150. SSL Connection Timer.
  151. =item B<sess_id>
  152. SSL Session Data Management.
  153. =item B<smime>
  154. S/MIME mail processing.
  155. =item B<speed>
  156. Algorithm Speed Measurement.
  157. =item B<spkac>
  158. SPKAC printing and generating utility.
  159. =item B<srp>
  160. Maintain SRP password file.
  161. =item B<storeutl>
  162. Utility to list and display certificates, keys, CRLs, etc.
  163. =item B<ts>
  164. Time Stamping Authority tool (client/server).
  165. =item B<verify>
  166. X.509 Certificate Verification.
  167. =item B<version>
  168. OpenSSL Version Information.
  169. =item B<x509>
  170. X.509 Certificate Data Management.
  171. =back
  172. =head2 Message Digest Commands
  173. =over 4
  174. =item B<blake2b512>
  175. BLAKE2b-512 Digest
  176. =item B<blake2s256>
  177. BLAKE2s-256 Digest
  178. =item B<md2>
  179. MD2 Digest
  180. =item B<md4>
  181. MD4 Digest
  182. =item B<md5>
  183. MD5 Digest
  184. =item B<mdc2>
  185. MDC2 Digest
  186. =item B<rmd160>
  187. RMD-160 Digest
  188. =item B<sha1>
  189. SHA-1 Digest
  190. =item B<sha224>
  191. SHA-2 224 Digest
  192. =item B<sha256>
  193. SHA-2 256 Digest
  194. =item B<sha384>
  195. SHA-2 384 Digest
  196. =item B<sha512>
  197. SHA-2 512 Digest
  198. =item B<sha3-224>
  199. SHA-3 224 Digest
  200. =item B<sha3-256>
  201. SHA-3 256 Digest
  202. =item B<sha3-384>
  203. SHA-3 384 Digest
  204. =item B<sha3-512>
  205. SHA-3 512 Digest
  206. =item B<shake128>
  207. SHA-3 SHAKE128 Digest
  208. =item B<shake256>
  209. SHA-3 SHAKE256 Digest
  210. =item B<sm3>
  211. SM3 Digest
  212. =back
  213. =head2 Encoding and Cipher Commands
  214. The following aliases provide convenient access to the most used encodings
  215. and ciphers.
  216. Depending on how OpenSSL was configured and built, not all ciphers listed
  217. here may be present. See L<enc(1)> for more information and command usage.
  218. =over 4
  219. =item B<aes128>, B<aes-128-cbc>, B<aes-128-cfb>, B<aes-128-ctr>, B<aes-128-ecb>, B<aes-128-ofb>
  220. AES-128 Cipher
  221. =item B<aes192>, B<aes-192-cbc>, B<aes-192-cfb>, B<aes-192-ctr>, B<aes-192-ecb>, B<aes-192-ofb>
  222. AES-192 Cipher
  223. =item B<aes256>, B<aes-256-cbc>, B<aes-256-cfb>, B<aes-256-ctr>, B<aes-256-ecb>, B<aes-256-ofb>
  224. AES-256 Cipher
  225. =item B<aria128>, B<aria-128-cbc>, B<aria-128-cfb>, B<aria-128-ctr>, B<aria-128-ecb>, B<aria-128-ofb>
  226. Aria-128 Cipher
  227. =item B<aria192>, B<aria-192-cbc>, B<aria-192-cfb>, B<aria-192-ctr>, B<aria-192-ecb>, B<aria-192-ofb>
  228. Aria-192 Cipher
  229. =item B<aria256>, B<aria-256-cbc>, B<aria-256-cfb>, B<aria-256-ctr>, B<aria-256-ecb>, B<aria-256-ofb>
  230. Aria-256 Cipher
  231. =item B<base64>
  232. Base64 Encoding
  233. =item B<bf>, B<bf-cbc>, B<bf-cfb>, B<bf-ecb>, B<bf-ofb>
  234. Blowfish Cipher
  235. =item B<camellia128>, B<camellia-128-cbc>, B<camellia-128-cfb>, B<camellia-128-ctr>, B<camellia-128-ecb>, B<camellia-128-ofb>
  236. Camellia-128 Cipher
  237. =item B<camellia192>, B<camellia-192-cbc>, B<camellia-192-cfb>, B<camellia-192-ctr>, B<camellia-192-ecb>, B<camellia-192-ofb>
  238. Camellia-192 Cipher
  239. =item B<camellia256>, B<camellia-256-cbc>, B<camellia-256-cfb>, B<camellia-256-ctr>, B<camellia-256-ecb>, B<camellia-256-ofb>
  240. Camellia-256 Cipher
  241. =item B<cast>, B<cast-cbc>
  242. CAST Cipher
  243. =item B<cast5-cbc>, B<cast5-cfb>, B<cast5-ecb>, B<cast5-ofb>
  244. CAST5 Cipher
  245. =item B<chacha20>
  246. Chacha20 Cipher
  247. =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>
  248. DES Cipher
  249. =item B<des3>, B<desx>, B<des-ede3>, B<des-ede3-cbc>, B<des-ede3-cfb>, B<des-ede3-ofb>
  250. Triple-DES Cipher
  251. =item B<idea>, B<idea-cbc>, B<idea-cfb>, B<idea-ecb>, B<idea-ofb>
  252. IDEA Cipher
  253. =item B<rc2>, B<rc2-cbc>, B<rc2-cfb>, B<rc2-ecb>, B<rc2-ofb>
  254. RC2 Cipher
  255. =item B<rc4>
  256. RC4 Cipher
  257. =item B<rc5>, B<rc5-cbc>, B<rc5-cfb>, B<rc5-ecb>, B<rc5-ofb>
  258. RC5 Cipher
  259. =item B<seed>, B<seed-cbc>, B<seed-cfb>, B<seed-ecb>, B<seed-ofb>
  260. SEED Cipher
  261. =item B<sm4>, B<sm4-cbc>, B<sm4-cfb>, B<sm4-ctr>, B<sm4-ecb>, B<sm4-ofb>
  262. SM4 Cipher
  263. =back
  264. =head1 OPTIONS
  265. Details of which options are available depend on the specific command.
  266. This section describes some common options with common behavior.
  267. =head2 Common Options
  268. =over 4
  269. =item B<-help>
  270. Provides a terse summary of all options.
  271. =back
  272. =head2 Pass Phrase Options
  273. Several commands accept password arguments, typically using B<-passin>
  274. and B<-passout> for input and output passwords respectively. These allow
  275. the password to be obtained from a variety of sources. Both of these
  276. options take a single argument whose format is described below. If no
  277. password argument is given and a password is required then the user is
  278. prompted to enter one: this will typically be read from the current
  279. terminal with echoing turned off.
  280. Note that character encoding may be relevant, please see
  281. L<passphrase-encoding(7)>.
  282. =over 4
  283. =item B<pass:password>
  284. The actual password is B<password>. Since the password is visible
  285. to utilities (like 'ps' under Unix) this form should only be used
  286. where security is not important.
  287. =item B<env:var>
  288. Obtain the password from the environment variable B<var>. Since
  289. the environment of other processes is visible on certain platforms
  290. (e.g. ps under certain Unix OSes) this option should be used with caution.
  291. =item B<file:pathname>
  292. The first line of B<pathname> is the password. If the same B<pathname>
  293. argument is supplied to B<-passin> and B<-passout> arguments then the first
  294. line will be used for the input password and the next line for the output
  295. password. B<pathname> need not refer to a regular file: it could for example
  296. refer to a device or named pipe.
  297. =item B<fd:number>
  298. Read the password from the file descriptor B<number>. This can be used to
  299. send the data via a pipe for example.
  300. =item B<stdin>
  301. Read the password from standard input.
  302. =back
  303. =head1 SEE ALSO
  304. L<asn1parse(1)>, L<ca(1)>, L<ciphers(1)>, L<cms(1)>, L<config(5)>,
  305. L<crl(1)>, L<crl2pkcs7(1)>, L<dgst(1)>,
  306. L<dhparam(1)>, L<dsa(1)>, L<dsaparam(1)>,
  307. L<ec(1)>, L<ecparam(1)>,
  308. L<enc(1)>, L<engine(1)>, L<errstr(1)>, L<gendsa(1)>, L<genpkey(1)>,
  309. L<genrsa(1)>, L<nseq(1)>, L<ocsp(1)>,
  310. L<passwd(1)>,
  311. L<pkcs12(1)>, L<pkcs7(1)>, L<pkcs8(1)>,
  312. L<pkey(1)>, L<pkeyparam(1)>, L<pkeyutl(1)>, L<prime(1)>,
  313. L<rand(1)>, L<rehash(1)>, L<req(1)>, L<rsa(1)>,
  314. L<rsautl(1)>, L<s_client(1)>,
  315. L<s_server(1)>, L<s_time(1)>, L<sess_id(1)>,
  316. L<smime(1)>, L<speed(1)>, L<spkac(1)>, L<srp(1)>, L<storeutl(1)>,
  317. L<ts(1)>,
  318. L<verify(1)>, L<version(1)>, L<x509(1)>,
  319. L<crypto(7)>, L<ssl(7)>, L<x509v3_config(5)>
  320. =head1 HISTORY
  321. The B<list->I<XXX>B<-algorithms> pseudo-commands were added in OpenSSL 1.0.0;
  322. For notes on the availability of other commands, see their individual
  323. manual pages.
  324. =head1 COPYRIGHT
  325. Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
  326. Licensed under the OpenSSL license (the "License"). You may not use
  327. this file except in compliance with the License. You can obtain a copy
  328. in the file LICENSE in the source distribution or at
  329. L<https://www.openssl.org/source/license.html>.
  330. =cut