2
0

openssl.pod 11 KB

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