summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjmc <>2010-10-06 13:21:02 +0000
committerjmc <>2010-10-06 13:21:02 +0000
commit38332e5243a001b52f96bb323cf35590a846c3e6 (patch)
treef3a3a86c0573147545bc9ee8b04455fc95b38662 /src
parent9f652c507315eb7637f7e01014c0e4c7324ddbb1 (diff)
downloadopenbsd-38332e5243a001b52f96bb323cf35590a846c3e6.tar.gz
openbsd-38332e5243a001b52f96bb323cf35590a846c3e6.tar.bz2
openbsd-38332e5243a001b52f96bb323cf35590a846c3e6.zip
catch up to openssl-1.0.0a; there's some new commands, as yet undocumented,
but i'll get to those shortly...
Diffstat (limited to 'src')
-rw-r--r--src/usr.sbin/openssl/openssl.1864
1 files changed, 650 insertions, 214 deletions
diff --git a/src/usr.sbin/openssl/openssl.1 b/src/usr.sbin/openssl/openssl.1
index 365fed721c..e5f12dfb6b 100644
--- a/src/usr.sbin/openssl/openssl.1
+++ b/src/usr.sbin/openssl/openssl.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: openssl.1,v 1.67 2010/02/18 13:39:21 schwarze Exp $ 1.\" $OpenBSD: openssl.1,v 1.68 2010/10/06 13:21:02 jmc Exp $
2.\" ==================================================================== 2.\" ====================================================================
3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4.\" 4.\"
@@ -112,7 +112,7 @@
112.\" 112.\"
113.\" OPENSSL 113.\" OPENSSL
114.\" 114.\"
115.Dd $Mdocdate: February 18 2010 $ 115.Dd $Mdocdate: October 6 2010 $
116.Dt OPENSSL 1 116.Dt OPENSSL 1
117.Os 117.Os
118.Sh NAME 118.Sh NAME
@@ -125,10 +125,12 @@
125.Op Ar command_args 125.Op Ar command_args
126.Pp 126.Pp
127.Nm 127.Nm
128.Oo Cm list-standard-commands No |\ \& 128.Cm list-standard-commands \*(Ba
129.Cm list-message-digest-commands | 129.Cm list-message-digest-commands \*(Ba
130.Cm list-cipher-commands 130.Cm list-cipher-commands \*(Ba
131.Oc 131.Cm list-cipher-algorithms \*(Ba
132.Cm list-message-digest-algorithms \*(Ba
133.Cm list-public-key-algorithms
132.Pp 134.Pp
133.Nm 135.Nm
134.Cm no- Ns Ar XXX 136.Cm no- Ns Ar XXX
@@ -152,7 +154,9 @@ It can be used for
152.Pp 154.Pp
153.Bl -bullet -offset indent -compact 155.Bl -bullet -offset indent -compact
154.It 156.It
155Creation of RSA, DH and DSA key parameters 157Creation and management of private keys, public keys, and parameters
158.It
159Public key cryptographic operations
156.It 160.It
157Creation of X.509 certificates, CSRs and CRLs 161Creation of X.509 certificates, CSRs and CRLs
158.It 162.It
@@ -163,6 +167,8 @@ Encryption and Decryption with Ciphers
163SSL/TLS Client and Server Tests 167SSL/TLS Client and Server Tests
164.It 168.It
165Handling of S/MIME signed or encrypted mail 169Handling of S/MIME signed or encrypted mail
170.It
171Time stamp requests, generation, and verification
166.El 172.El
167.Sh COMMAND SUMMARY 173.Sh COMMAND SUMMARY
168The 174The
@@ -190,6 +196,20 @@ or cipher commands, respectively, that are available in the present
190.Nm 196.Nm
191utility. 197utility.
192.Pp 198.Pp
199The pseudo-commands
200.Cm list-cipher-algorithms
201and
202.Cm list-message-digest-algorithms
203list all cipher and message digest names,
204one entry per line.
205Aliases are listed as:
206.Pp
207.D1 from => to
208.Pp
209The pseudo-command
210.Cm list-public-key-algorithms
211lists all supported public key algorithms.
212.Pp
193The pseudo-command 213The pseudo-command
194.Cm no- Ns Ar XXX 214.Cm no- Ns Ar XXX
195tests whether a command of the 215tests whether a command of the
@@ -229,39 +249,55 @@ Parse an ASN.1 sequence.
229.It Cm ca 249.It Cm ca
230Certificate Authority 250Certificate Authority
231.Pq CA 251.Pq CA
232Management. 252management.
233.It Cm ciphers 253.It Cm ciphers
234Cipher Suite Description Determination. 254Cipher suite description determination.
235.It Cm crl 255.It Cm crl
236Certificate Revocation List 256Certificate Revocation List
237.Pq CRL 257.Pq CRL
238Management. 258management.
239.It Cm crl2pkcs7 259.It Cm crl2pkcs7
240CRL to PKCS#7 Conversion. 260CRL to PKCS#7 conversion.
241.It Cm dgst 261.It Cm dgst
242Message Digest Calculation. 262Message digest calculation.
243.It Cm dh 263.It Cm dh
244Diffie-Hellman Parameter Management. 264Diffie-Hellman parameter management.
245Obsoleted by 265Obsoleted by
246.Cm dhparam . 266.Cm dhparam .
247.It Cm dhparam 267.It Cm dhparam
248Generation and Management of Diffie-Hellman Parameters. 268Generation and management of Diffie-Hellman parameters.
269Superseded by
270.Cm genpkey
271and
272.Cm pkeyparam .
249.It Cm dsa 273.It Cm dsa
250DSA Data Management. 274DSA data management.
251.It Cm dsaparam 275.It Cm dsaparam
252DSA Parameter Generation. 276DSA parameter generation and management.
277Superseded by
278.Cm genpkey
279and
280.Cm pkeyparam .
253.It Cm enc 281.It Cm enc
254Encoding with Ciphers. 282Encoding with ciphers.
283.It Cm engine
284Engine (loadable module) information and manipulation.
255.It Cm errstr 285.It Cm errstr
256Error Number to Error String Conversion. 286Error number to error string conversion.
257.It Cm gendh 287.It Cm gendh
258Generation of Diffie-Hellman Parameters. 288Generation of Diffie-Hellman parameters.
259Obsoleted by 289Obsoleted by
260.Cm dhparam . 290.Cm dhparam .
261.It Cm gendsa 291.It Cm gendsa
262Generation of DSA Parameters. 292Generation of DSA private key from parameters.
293Superseded by
294.Cm genpkey
295and
296.Cm pkey .
263.It Cm genrsa 297.It Cm genrsa
264Generation of RSA Parameters. 298Generation of RSA private key.
299Superseded by
300.Cm genpkey .
265.It Cm nseq 301.It Cm nseq
266Create or examine a Netscape certificate sequence. 302Create or examine a Netscape certificate sequence.
267.It Cm ocsp 303.It Cm ocsp
@@ -269,21 +305,23 @@ Online Certificate Status Protocol utility.
269.It Cm passwd 305.It Cm passwd
270Generation of hashed passwords. 306Generation of hashed passwords.
271.It Cm pkcs7 307.It Cm pkcs7
272PKCS#7 Data Management. 308PKCS#7 data management.
273.It Cm pkcs8 309.It Cm pkcs8
274PKCS#8 Data Management. 310PKCS#8 data management.
275.It Cm pkcs12 311.It Cm pkcs12
276PKCS#12 Data Management. 312PKCS#12 data management.
277.It Cm rand 313.It Cm rand
278Generate pseudo-random bytes. 314Generate pseudo-random bytes.
279.It Cm req 315.It Cm req
280X.509 Certificate Signing Request 316PKCS#10 X.509 Certificate Signing Request
281.Pq CSR 317.Pq CSR
282Management. 318management.
283.It Cm rsa 319.It Cm rsa
284RSA Data Management. 320RSA key management.
285.It Cm rsautl 321.It Cm rsautl
286RSA utility for signing, verification, encryption, and decryption. 322RSA utility for signing, verification, encryption, and decryption.
323Superseded by
324.Cm pkeyutl .
287.It Cm s_client 325.It Cm s_client
288This implements a generic SSL/TLS client which can establish a transparent 326This implements a generic SSL/TLS client which can establish a transparent
289connection to a remote server speaking SSL/TLS. 327connection to a remote server speaking SSL/TLS.
@@ -304,80 +342,80 @@ It provides both an own command line oriented protocol for testing
304SSL functions and a simple HTTP response 342SSL functions and a simple HTTP response
305facility to emulate an SSL/TLS-aware webserver. 343facility to emulate an SSL/TLS-aware webserver.
306.It Cm s_time 344.It Cm s_time
307SSL Connection Timer. 345SSL connection timer.
308.It Cm sess_id 346.It Cm sess_id
309SSL Session Data Management. 347SSL session data management.
310.It Cm smime 348.It Cm smime
311S/MIME mail processing. 349S/MIME mail processing.
312.It Cm speed 350.It Cm speed
313Algorithm Speed Measurement. 351Algorithm speed measurement.
314.It Cm spkac 352.It Cm spkac
315SPKAC printing and generating utility. 353SPKAC printing and generating utility.
316.It Cm verify 354.It Cm verify
317X.509 Certificate Verification. 355X.509 certificate verification.
318.It Cm version 356.It Cm version
319.Nm OpenSSL 357.Nm OpenSSL
320Version Information. 358version information.
321.It Cm x509 359.It Cm x509
322X.509 Certificate Data Management. 360X.509 certificate data management.
323.El 361.El
324.Sh MESSAGE DIGEST COMMANDS 362.Sh MESSAGE DIGEST COMMANDS
325.Bl -tag -width "asn1parse" 363.Bl -tag -width "asn1parse"
326.It Cm md2 364.It Cm md2
327MD2 Digest. 365MD2 digest.
328.It Cm md4 366.It Cm md4
329MD4 Digest. 367MD4 digest.
330.It Cm md5 368.It Cm md5
331MD5 Digest. 369MD5 digest.
332.It Cm ripemd160 370.It Cm ripemd160
333RIPEMD-160 Digest. 371RIPEMD-160 digest.
334.It Cm sha 372.It Cm sha
335SHA Digest. 373SHA digest.
336.It Cm sha1 374.It Cm sha1
337SHA-1 Digest. 375SHA-1 digest.
338.El 376.El
339.Sh ENCODING AND CIPHER COMMANDS 377.Sh ENCODING AND CIPHER COMMANDS
340.Bl -tag -width Ds -compact 378.Bl -tag -width Ds -compact
341.It Cm aes-128-cbc | aes-128-ecb | aes-192-cbc | aes-192-ecb 379.It Cm aes-128-cbc | aes-128-ecb | aes-192-cbc | aes-192-ecb
342.It Cm aes-256-cbc | aes-256-ecb 380.It Cm aes-256-cbc | aes-256-ecb
343AES Cipher. 381AES cipher.
344.Pp 382.Pp
345.It Cm base64 383.It Cm base64
346Base64 Encoding. 384Base64 encoding.
347.Pp 385.Pp
348.It Xo 386.It Xo
349.Cm bf | bf-cbc | bf-cfb | 387.Cm bf | bf-cbc | bf-cfb |
350.Cm bf-ecb | bf-ofb 388.Cm bf-ecb | bf-ofb
351.Xc 389.Xc
352Blowfish Cipher. 390Blowfish cipher.
353.Pp 391.Pp
354.It Cm cast | cast-cbc 392.It Cm cast | cast-cbc
355CAST Cipher. 393CAST cipher.
356.Pp 394.Pp
357.It Cm cast5-cbc | cast5-cfb | cast5-ecb | cast5-ofb 395.It Cm cast5-cbc | cast5-cfb | cast5-ecb | cast5-ofb
358CAST5 Cipher. 396CAST5 cipher.
359.Pp 397.Pp
360.It Xo 398.It Xo
361.Cm des | des-cbc | des-cfb | des-ecb | 399.Cm des | des-cbc | des-cfb | des-ecb |
362.Cm des-ede | des-ede-cbc 400.Cm des-ede | des-ede-cbc
363.Xc 401.Xc
364.It Cm des-ede-cfb | des-ede-ofb | des-ofb 402.It Cm des-ede-cfb | des-ede-ofb | des-ofb
365DES Cipher. 403DES cipher.
366.Pp 404.Pp
367.It Xo 405.It Xo
368.Cm des3 | desx | des-ede3 | 406.Cm des3 | desx | des-ede3 |
369.Cm des-ede3-cbc | des-ede3-cfb | des-ede3-ofb 407.Cm des-ede3-cbc | des-ede3-cfb | des-ede3-ofb
370.Xc 408.Xc
371Triple DES Cipher. 409Triple DES cipher.
372.Pp 410.Pp
373.It Xo 411.It Xo
374.Cm rc2 | rc2-40-cbc | rc2-64-cbc | rc2-cbc | 412.Cm rc2 | rc2-40-cbc | rc2-64-cbc | rc2-cbc |
375.Cm rc2-cfb | rc2-ecb | rc2-ofb 413.Cm rc2-cfb | rc2-ecb | rc2-ofb
376.Xc 414.Xc
377RC2 Cipher. 415RC2 cipher.
378.Pp 416.Pp
379.It Cm rc4 | rc4-40 417.It Cm rc4 | rc4-40
380RC4 Cipher. 418RC4 cipher.
381.El 419.El
382.Sh PASS PHRASE ARGUMENTS 420.Sh PASS PHRASE ARGUMENTS
383Several commands accept password arguments, typically using 421Several commands accept password arguments, typically using
@@ -441,6 +479,8 @@ Read the password from standard input.
441.Op Fl i 479.Op Fl i
442.Op Fl noout 480.Op Fl noout
443.Op Fl dlimit Ar number 481.Op Fl dlimit Ar number
482.Op Fl genconf Ar file
483.Op Fl genstr Ar str
444.Op Fl in Ar file 484.Op Fl in Ar file
445.Op Fl inform Ar DER | PEM | TXT 485.Op Fl inform Ar DER | PEM | TXT
446.Op Fl length Ar number 486.Op Fl length Ar number
@@ -463,6 +503,24 @@ Dump the first
463bytes of unknown data in hex form. 503bytes of unknown data in hex form.
464.It Fl dump 504.It Fl dump
465Dump unknown data in hex form. 505Dump unknown data in hex form.
506.It Fl genconf Ar file , Fl genstr Ar str
507Generate encoded data based on string
508.Ar str ,
509file
510.Ar file ,
511or both using
512.Xr ASN1_generate_nconf 3
513format.
514If only
515.Ar file
516is present then the string is obtained from the default section
517using the name
518.Dq asn1 .
519The encoded data is passed through the ASN1 parser and printed out as
520though it came from a file;
521the contents can thus be examined and written to a file using the
522.Fl out
523option.
466.It Fl i 524.It Fl i
467Indents the output according to the 525Indents the output according to the
468.Qq depth 526.Qq depth
@@ -664,7 +722,7 @@ This allows the expiry date to be explicitly set.
664The format of the date is YYMMDDHHMMSSZ 722The format of the date is YYMMDDHHMMSSZ
665.Pq the same as an ASN1 UTCTime structure . 723.Pq the same as an ASN1 UTCTime structure .
666.It Fl engine Ar id 724.It Fl engine Ar id
667Specifying an engine (by it's unique 725Specifying an engine (by its unique
668.Ar id 726.Ar id
669string) will cause 727string) will cause
670.Nm ca 728.Nm ca
@@ -1332,9 +1390,8 @@ then even if a certificate is issued with CA:TRUE it will not be valid.
1332.\" 1390.\"
1333.Sh CIPHERS 1391.Sh CIPHERS
1334.Nm openssl ciphers 1392.Nm openssl ciphers
1335.Op Fl h 1393.Op Fl hVv
1336.Op Fl ssl2 | ssl3 | tls1 1394.Op Fl ssl2 | ssl3 | tls1
1337.Op Fl v
1338.Op Ar cipherlist 1395.Op Ar cipherlist
1339.Pp 1396.Pp
1340The 1397The
@@ -1354,6 +1411,10 @@ Only include SSL v2 ciphers.
1354Only include SSL v3 ciphers. 1411Only include SSL v3 ciphers.
1355.It Fl tls1 1412.It Fl tls1
1356Only include TLS v1 ciphers. 1413Only include TLS v1 ciphers.
1414.It Fl V
1415Like
1416.Fl v ,
1417but include cipher suite codes in output (hex format).
1357.It Fl v 1418.It Fl v
1358Verbose option. 1419Verbose option.
1359List ciphers with a complete description of protocol version 1420List ciphers with a complete description of protocol version
@@ -1484,8 +1545,6 @@ Export encryption algorithms.
1484Including 40- and 56-bit algorithms. 1545Including 40- and 56-bit algorithms.
1485.It Ar EXPORT40 1546.It Ar EXPORT40
148640-bit export encryption algorithms. 154740-bit export encryption algorithms.
1487.It Ar EXPORT56
148856-bit export encryption algorithms.
1489.It Ar eNULL , NULL 1548.It Ar eNULL , NULL
1490The 1549The
1491.Qq NULL 1550.Qq NULL
@@ -1502,22 +1561,10 @@ attack, so their use is normally discouraged.
1502Cipher suites using RSA key exchange. 1561Cipher suites using RSA key exchange.
1503.It Ar kEDH 1562.It Ar kEDH
1504Cipher suites using ephemeral DH key agreement. 1563Cipher suites using ephemeral DH key agreement.
1505.It Ar kDHr , kDHd
1506Cipher suites using DH key agreement and DH certificates signed by
1507CAs with RSA and DSS keys respectively.
1508Not implemented.
1509.It Ar aRSA 1564.It Ar aRSA
1510Cipher suites using RSA authentication, i.e. the certificates carry RSA keys. 1565Cipher suites using RSA authentication, i.e. the certificates carry RSA keys.
1511.It Ar aDSS , DSS 1566.It Ar aDSS , DSS
1512Cipher suites using DSS authentication, i.e. the certificates carry DSS keys. 1567Cipher suites using DSS authentication, i.e. the certificates carry DSS keys.
1513.It Ar aDH
1514Cipher suites effectively using DH authentication, i.e. the certificates carry
1515DH keys.
1516Not implemented.
1517.It Ar kFZA , aFZA , eFZA , FZA
1518Cipher suites using FORTEZZA key exchange, authentication, encryption
1519or all FORTEZZA algorithms.
1520Not implemented.
1521.It Ar TLSv1 , SSLv3 , SSLv2 1568.It Ar TLSv1 , SSLv3 , SSLv2
1522TLS v1.0, SSL v3.0 or SSL v2.0 cipher suites, respectively. 1569TLS v1.0, SSL v3.0 or SSL v2.0 cipher suites, respectively.
1523.It Ar DH 1570.It Ar DH
@@ -1634,6 +1681,18 @@ TLS_DHE_RSA_WITH_AES_256_CBC_SHA DHE-RSA-AES256-SHA
1634TLS_DH_anon_WITH_AES_128_CBC_SHA ADH-AES128-SHA 1681TLS_DH_anon_WITH_AES_128_CBC_SHA ADH-AES128-SHA
1635TLS_DH_anon_WITH_AES_256_CBC_SHA ADH-AES256-SHA 1682TLS_DH_anon_WITH_AES_256_CBC_SHA ADH-AES256-SHA
1636.Ed 1683.Ed
1684.Ss GOST ciphersuites from draft-chudov-cryptopro-cptls, extending TLS v1.0
1685.Sy Note :
1686These ciphers require an engine which includes GOST cryptographic
1687algorithms, such as the
1688.Dq ccgost
1689engine, included in the OpenSSL distribution.
1690.Bd -unfilled -offset indent
1691TLS_GOSTR341094_WITH_28147_CNT_IMIT GOST94-GOST89-GOST89
1692TLS_GOSTR341001_WITH_28147_CNT_IMIT GOST2001-GOST89-GOST89
1693TLS_GOSTR341094_WITH_NULL_GOSTR3411 GOST94-NULL-GOST94
1694TLS_GOSTR341001_WITH_NULL_GOSTR3411 GOST2001-NULL-GOST94
1695.Ed
1637.Ss Additional Export 1024 and other cipher suites 1696.Ss Additional Export 1024 and other cipher suites
1638.Sy Note : 1697.Sy Note :
1639These ciphers can also be used in SSL v3. 1698These ciphers can also be used in SSL v3.
@@ -1692,7 +1751,17 @@ The
1692.Ar COMPLEMENTOFALL 1751.Ar COMPLEMENTOFALL
1693and 1752and
1694.Ar COMPLEMENTOFDEFAULT 1753.Ar COMPLEMENTOFDEFAULT
1695selection options were added in version 0.9.7. 1754selection options were added in
1755.Nm OpenSSL
17560.9.7.
1757.Pp
1758The
1759.Fl V
1760option of the
1761.Nm ciphers
1762command was added in
1763.Nm OpenSSL
17641.0.0.
1696.\" 1765.\"
1697.\" CRL 1766.\" CRL
1698.\" 1767.\"
@@ -1875,18 +1944,20 @@ install user certificates and CAs in MSIE using the Xenroll control.
1875.Fl ripemd160 | sha | sha1 1944.Fl ripemd160 | sha | sha1
1876.Oc 1945.Oc
1877.Op Fl binary 1946.Op Fl binary
1878.Op Fl c 1947.Op Fl cd
1879.Op Fl d
1880.Op Fl hex 1948.Op Fl hex
1881.Op Fl hmac Ar key 1949.Op Fl hmac Ar key
1882.Op Fl engine Ar id 1950.Op Fl engine Ar id
1883.Op Fl keyform Ar ENGINE | PEM 1951.Op Fl keyform Ar ENGINE | PEM
1952.Op Fl mac Ar algorithm
1953.Op Fl macopt Ar nm : Ns Ar v
1884.Op Fl out Ar file 1954.Op Fl out Ar file
1885.Op Fl passin Ar arg 1955.Op Fl passin Ar arg
1886.Op Fl prverify Ar file 1956.Op Fl prverify Ar file
1887.Op Fl rand Ar 1957.Op Fl rand Ar
1888.Op Fl sign Ar file 1958.Op Fl sign Ar file
1889.Op Fl signature Ar file 1959.Op Fl signature Ar file
1960.Op Fl sigopt Ar nm : Ns Ar v
1890.Op Fl verify Ar file 1961.Op Fl verify Ar file
1891.Op Ar 1962.Op Ar
1892.Ek 1963.Ek
@@ -1918,13 +1989,15 @@ format output is used.
1918.It Fl d 1989.It Fl d
1919Print out BIO debugging information. 1990Print out BIO debugging information.
1920.It Fl engine Ar id 1991.It Fl engine Ar id
1921Specifying an engine (by it's unique 1992Specifying an engine (by its unique
1922.Ar id 1993.Ar id
1923string) will cause 1994string) will cause
1924.Nm dgst 1995.Nm dgst
1925to attempt to obtain a functional reference to the specified engine, 1996to attempt to obtain a functional reference to the specified engine,
1926thus initialising it if needed. 1997thus initialising it if needed.
1927The engine will then be set as the default for all available algorithms. 1998The engine will then be set as the default for all available algorithms.
1999This engine is not used as a source for digest algorithms
2000unless it is also specified in the configuration file.
1928.It Fl hex 2001.It Fl hex
1929Digest is to be output as a hex dump. 2002Digest is to be output as a hex dump.
1930This is the default case for a 2003This is the default case for a
@@ -1934,7 +2007,31 @@ digest as opposed to a digital signature.
1934Create a hashed MAC using 2007Create a hashed MAC using
1935.Ar key . 2008.Ar key .
1936.It Fl keyform Ar ENGINE | PEM 2009.It Fl keyform Ar ENGINE | PEM
1937Key file format. 2010Specifies the key format to sign the digest with.
2011.It Fl mac Ar algorithm
2012Create a keyed Message Authentication Code (MAC).
2013The most popular MAC algorithm is HMAC (hash-based MAC),
2014but there are other MAC algorithms which are not based on hash,
2015for instance the gost-mac algorithm,
2016supported by the ccgost engine.
2017MAC keys and other options should be set via the
2018.Fl macopt
2019parameter.
2020.It Fl macopt Ar nm : Ns Ar v
2021Passes options to the MAC algorithm, specified by
2022.Fl mac .
2023The following options are supported by both by HMAC and gost-mac:
2024.Bl -tag -width Ds
2025.It Ar key : Ns Ar string
2026Specifies the MAC key as an alphanumeric string
2027(use if the key contain printable characters only).
2028String length must conform to any restrictions of the MAC algorithm,
2029for example exactly 32 chars for gost-mac.
2030.It Ar hexkey : Ns Ar string
2031Specifies the MAC key in hexadecimal form (two hex digits per byte).
2032Key length must conform to any restrictions of the MAC algorithm,
2033for example exactly 32 chars for gost-mac.
2034.El
1938.It Fl out Ar file 2035.It Fl out Ar file
1939The file to output to, or standard output by default. 2036The file to output to, or standard output by default.
1940.It Fl passin Ar arg 2037.It Fl passin Ar arg
@@ -1962,6 +2059,9 @@ Digitally sign the digest using the private key in
1962.Ar file . 2059.Ar file .
1963.It Fl signature Ar file 2060.It Fl signature Ar file
1964The actual signature to verify. 2061The actual signature to verify.
2062.It Fl sigopt Ar nm : Ns Ar v
2063Pass options to the signature algorithm during sign or verify operations.
2064The names and values of these options are algorithm-specific.
1965.It Fl verify Ar file 2065.It Fl verify Ar file
1966Verify the signature using the public key in 2066Verify the signature using the public key in
1967.Ar file . 2067.Ar file .
@@ -2053,7 +2153,7 @@ Beware that with such DSA-style DH parameters,
2053a fresh DH key should be created for each use to 2153a fresh DH key should be created for each use to
2054avoid small-subgroup attacks that may be possible otherwise. 2154avoid small-subgroup attacks that may be possible otherwise.
2055.It Fl engine Ar id 2155.It Fl engine Ar id
2056Specifying an engine (by it's unique 2156Specifying an engine (by its unique
2057.Ar id 2157.Ar id
2058string) will cause 2158string) will cause
2059.Nm dhparam 2159.Nm dhparam
@@ -2203,7 +2303,7 @@ or by setting the encryption options it can be use to add or change
2203the pass phrase. 2303the pass phrase.
2204These options can only be used with PEM format output files. 2304These options can only be used with PEM format output files.
2205.It Fl engine Ar id 2305.It Fl engine Ar id
2206Specifying an engine (by it's unique 2306Specifying an engine (by its unique
2207.Ar id 2307.Ar id
2208string) will cause 2308string) will cause
2209.Nm dsa 2309.Nm dsa
@@ -2338,7 +2438,7 @@ The parameters can then be loaded by calling the
2338.Cm get_dsa Ns Ar XXX Ns Li () 2438.Cm get_dsa Ns Ar XXX Ns Li ()
2339function. 2439function.
2340.It Fl engine Ar id 2440.It Fl engine Ar id
2341Specifying an engine (by it's unique 2441Specifying an engine (by its unique
2342.Ar id 2442.Ar id
2343string) will cause 2443string) will cause
2344.Nm dsaparam 2444.Nm dsaparam
@@ -2413,17 +2513,20 @@ DSA parameters is often used to generate several distinct keys.
2413.Bk -words 2513.Bk -words
2414.Fl ciphername 2514.Fl ciphername
2415.Op Fl AadePp 2515.Op Fl AadePp
2516.Op Fl base64
2416.Op Fl debug 2517.Op Fl debug
2417.Op Fl engine Ar id 2518.Op Fl none
2418.Op Fl nopad 2519.Op Fl nopad
2419.Op Fl nosalt 2520.Op Fl nosalt
2420.Op Fl salt 2521.Op Fl salt
2421.Op Fl bufsize Ar number 2522.Op Fl bufsize Ar number
2523.Op Fl engine Ar id
2422.Op Fl in Ar file 2524.Op Fl in Ar file
2423.Op Fl iv Ar IV 2525.Op Fl iv Ar IV
2424.Op Fl K Ar key 2526.Op Fl K Ar key
2425.Op Fl k Ar password 2527.Op Fl k Ar password
2426.Op Fl kfile Ar file 2528.Op Fl kfile Ar file
2529.Op Fl md Ar digest
2427.Op Fl out Ar file 2530.Op Fl out Ar file
2428.Op Fl pass Ar arg 2531.Op Fl pass Ar arg
2429.Op Fl S Ar salt 2532.Op Fl S Ar salt
@@ -2441,7 +2544,7 @@ The options are as follows:
2441If the 2544If the
2442.Fl a 2545.Fl a
2443option is set, then base64 process the data on one line. 2546option is set, then base64 process the data on one line.
2444.It Fl a 2547.It Fl a , base64
2445Base64 process the data. 2548Base64 process the data.
2446This means that if encryption is taking place, the data is base64-encoded 2549This means that if encryption is taking place, the data is base64-encoded
2447after encryption. 2550after encryption.
@@ -2456,7 +2559,7 @@ Debug the BIOs used for I/O.
2456.It Fl e 2559.It Fl e
2457Encrypt the input data: this is the default. 2560Encrypt the input data: this is the default.
2458.It Fl engine Ar id 2561.It Fl engine Ar id
2459Specifying an engine (by it's unique 2562Specifying an engine (by its unique
2460.Ar id 2563.Ar id
2461string) will cause 2564string) will cause
2462.Nm enc 2565.Nm enc
@@ -2526,6 +2629,19 @@ This is for compatibility with previous versions of
2526Superseded by the 2629Superseded by the
2527.Fl pass 2630.Fl pass
2528option. 2631option.
2632.It Fl md Ar digest
2633Use
2634.Ar digest
2635to create a key from a passphrase.
2636.Ar digest
2637may be one of
2638.Dq md2 ,
2639.Dq md5 ,
2640.Dq sha ,
2641or
2642.Dq sha1 .
2643.It Fl none
2644Use NULL cipher (no encryption or decryption of input).
2529.It Fl nopad 2645.It Fl nopad
2530Disable standard block padding. 2646Disable standard block padding.
2531.It Fl nosalt 2647.It Fl nosalt
@@ -2581,6 +2697,26 @@ The program can be called either as
2581.Nm openssl ciphername 2697.Nm openssl ciphername
2582or 2698or
2583.Nm openssl enc -ciphername . 2699.Nm openssl enc -ciphername .
2700But the first form doesn't work with engine-provided ciphers,
2701because this form is processed before the
2702configuration file is read and any engines loaded.
2703.Pp
2704Engines which provide entirely new encryption algorithms
2705(such as the ccgost engine which provides the gost89 algorithm)
2706should be configured in the configuration file.
2707Engines, specified on the command line using the
2708.Fl engine
2709option,
2710can only be used for hardware-assisted implementations of ciphers,
2711supported by
2712.Nm OpenSSL
2713core, or by other engines specified in the configuration file.
2714.Pp
2715When
2716.Nm enc
2717lists supported ciphers,
2718ciphers provided by engines specified in the configuration files
2719are listed too.
2584.Pp 2720.Pp
2585A password will be prompted for to derive the 2721A password will be prompted for to derive the
2586.Ar key 2722.Ar key
@@ -2629,59 +2765,58 @@ All RC2 ciphers have the same key and effective key length.
2629Blowfish and RC5 algorithms use a 128-bit key. 2765Blowfish and RC5 algorithms use a 128-bit key.
2630.Sh ENC SUPPORTED CIPHERS 2766.Sh ENC SUPPORTED CIPHERS
2631.Bd -unfilled -offset indent 2767.Bd -unfilled -offset indent
2632aes-128-cbc 128-bit AES in CBC mode 2768aes-[128|192|256]-cbc 128/192/256 bit AES in CBC mode
2633aes-128-ecb 128-bit AES in ECB mode 2769aes-[128|192|256] Alias for aes-[128|192|256]-cbc
2770aes-[128|192|256]-cfb 128/192/256 bit AES in 128 bit CFB mode
2771aes-[128|192|256]-cfb1 128/192/256 bit AES in 1 bit CFB mode
2772aes-[128|192|256]-cfb8 128/192/256 bit AES in 8 bit CFB mode
2773aes-[128|192|256]-ecb 128/192/256 bit AES in ECB mode
2774aes-[128|192|256]-ofb 128/192/256 bit AES in OFB mode
2634 2775
2635aes-192-cbc 192-bit AES in CBC mode 2776base64 Base 64
2636aes-192-ecb 192-bit AES in ECB mode
2637 2777
2638aes-256-cbc 256-bit AES in CBC mode 2778bf Alias for bf-cbc
2639aes-256-ecb 256-bit AES in ECB mode 2779bf-cbc Blowfish in CBC mode
2780bf-cfb Blowfish in CFB mode
2781bf-ecb Blowfish in ECB mode
2782bf-ofb Blowfish in OFB mode
2640 2783
2641base64 Base 64 2784cast Alias for cast-cbc
2785cast-cbc CAST in CBC mode
2786cast5-cbc CAST5 in CBC mode
2787cast5-cfb CAST5 in CFB mode
2788cast5-ecb CAST5 in ECB mode
2789cast5-ofb CAST5 in OFB mode
2642 2790
2643bf Alias for bf-cbc 2791des Alias for des-cbc
2644bf-cbc Blowfish in CBC mode 2792des-cbc DES in CBC mode
2645bf-cfb Blowfish in CFB mode 2793des-cfb DES in CBC mode
2646bf-ecb Blowfish in ECB mode 2794des-ecb DES in ECB mode
2647bf-ofb Blowfish in OFB mode 2795des-ofb DES in OFB mode
2648 2796
2649cast Alias for cast-cbc 2797des-ede Two key triple DES EDE in ECB mode
2650cast-cbc CAST in CBC mode 2798des-ede-cbc Two key triple DES EDE in CBC mode
2651cast5-cbc CAST5 in CBC mode 2799des-ede-cfb Two key triple DES EDE in CFB mode
2652cast5-cfb CAST5 in CFB mode 2800des-ede-ofb Two key triple DES EDE in OFB mode
2653cast5-ecb CAST5 in ECB mode
2654cast5-ofb CAST5 in OFB mode
2655 2801
2656des Alias for des-cbc 2802des3 Alias for des-ede3-cbc
2657des-cbc DES in CBC mode 2803des-ede3 Three key triple DES EDE in ECB mode
2658des-cfb DES in CBC mode 2804des-ede3-cbc Three key triple DES EDE in CBC mode
2659des-ecb DES in ECB mode 2805des-ede3-cfb Three key triple DES EDE CFB mode
2660des-ofb DES in OFB mode 2806des-ede3-ofb Three key triple DES EDE in OFB mode
2661 2807
2662des-ede Two key triple DES EDE in ECB mode 2808desx DESX algorithm
2663des-ede-cbc Two key triple DES EDE in CBC mode
2664des-ede-cfb Two key triple DES EDE in CFB mode
2665des-ede-ofb Two key triple DES EDE in OFB mode
2666 2809
2667des3 Alias for des-ede3-cbc 2810rc2 Alias for rc2-cbc
2668des-ede3 Three key triple DES EDE in ECB mode 2811rc2-cbc 128-bit RC2 in CBC mode
2669des-ede3-cbc Three key triple DES EDE in CBC mode 2812rc2-cfb 128-bit RC2 in CFB mode
2670des-ede3-cfb Three key triple DES EDE CFB mode 2813rc2-ecb 128-bit RC2 in ECB mode
2671des-ede3-ofb Three key triple DES EDE in OFB mode 2814rc2-ofb 128-bit RC2 in OFB mode
2815rc2-64-cbc 64-bit RC2 in CBC mode
2816rc2-40-cbc 40-bit RC2 in CBC mode
2672 2817
2673desx Alias for desx-cbc 2818rc4 128-bit RC4
2674 2819rc4-40 40-bit RC4
2675rc2 Alias for rc2-cbc
2676rc2-cbc 128-bit RC2 in CBC mode
2677rc2-cfb 128-bit RC2 in CFB mode
2678rc2-ecb 128-bit RC2 in ECB mode
2679rc2-ofb 128-bit RC2 in OFB mode
2680rc2-64-cbc 64-bit RC2 in CBC mode
2681rc2-40-cbc 40-bit RC2 in CBC mode
2682
2683rc4 128-bit RC4
2684rc4-40 40-bit RC4
2685.Ed 2820.Ed
2686.Sh ENC EXAMPLES 2821.Sh ENC EXAMPLES
2687Just base64 encode a binary file: 2822Just base64 encode a binary file:
@@ -2810,7 +2945,7 @@ or the triple DES ciphers, respectively, before outputting it.
2810A pass phrase is prompted for. 2945A pass phrase is prompted for.
2811If none of these options are specified, no encryption is used. 2946If none of these options are specified, no encryption is used.
2812.It Fl engine Ar id 2947.It Fl engine Ar id
2813Specifying an engine (by it's unique 2948Specifying an engine (by its unique
2814.Ar id 2949.Ar id
2815string) will cause 2950string) will cause
2816.Nm gendsa 2951.Nm gendsa
@@ -2873,7 +3008,7 @@ if it is not supplied via the
2873.Fl passout 3008.Fl passout
2874option. 3009option.
2875.It Fl engine Ar id 3010.It Fl engine Ar id
2876Specifying an engine (by it's unique 3011Specifying an engine (by its unique
2877.Ar id 3012.Ar id
2878string) will cause 3013string) will cause
2879.Nm genrsa 3014.Nm genrsa
@@ -3013,6 +3148,7 @@ and allowing multiple certificate files to be used.
3013.Op Fl CAfile Ar file 3148.Op Fl CAfile Ar file
3014.Op Fl CApath Ar directory 3149.Op Fl CApath Ar directory
3015.Op Fl cert Ar file 3150.Op Fl cert Ar file
3151.Op Fl dgst Ar alg
3016.Oo 3152.Oo
3017.Fl host 3153.Fl host
3018.Ar hostname : Ns Ar port 3154.Ar hostname : Ns Ar port
@@ -3072,6 +3208,10 @@ to the request.
3072The issuer certificate is taken from the previous 3208The issuer certificate is taken from the previous
3073.Fl issuer 3209.Fl issuer
3074option, or an error occurs if no issuer certificate is specified. 3210option, or an error occurs if no issuer certificate is specified.
3211.It Fl dgst Ar alg
3212Sets the digest algorithm to use for certificate identification
3213in the OCSP request.
3214By default SHA-1 is used.
3075.It Xo 3215.It Xo
3076.Fl host Ar hostname : Ns Ar port , 3216.Fl host Ar hostname : Ns Ar port ,
3077.Fl path Ar path 3217.Fl path Ar path
@@ -3569,7 +3709,7 @@ command processes PKCS#7 files in DER or PEM format.
3569The options are as follows: 3709The options are as follows:
3570.Bl -tag -width "XXXX" 3710.Bl -tag -width "XXXX"
3571.It Fl engine Ar id 3711.It Fl engine Ar id
3572Specifying an engine (by it's unique 3712Specifying an engine (by its unique
3573.Ar id 3713.Ar id
3574string) will cause 3714string) will cause
3575.Nm pkcs7 3715.Nm pkcs7
@@ -3675,7 +3815,7 @@ two structures:
3675a SEQUENCE containing the parameters and an ASN1 INTEGER containing 3815a SEQUENCE containing the parameters and an ASN1 INTEGER containing
3676the private key. 3816the private key.
3677.It Fl engine Ar id 3817.It Fl engine Ar id
3678Specifying an engine (by it's unique 3818Specifying an engine (by its unique
3679.Ar id 3819.Ar id
3680string) will cause 3820string) will cause
3681.Nm pkcs8 3821.Nm pkcs8
@@ -3906,6 +4046,7 @@ compatibility, several of the utilities use the old format at present.
3906.Op Fl nodes 4046.Op Fl nodes
3907.Op Fl noiter 4047.Op Fl noiter
3908.Op Fl nokeys 4048.Op Fl nokeys
4049.Op Fl nomac
3909.Op Fl nomaciter 4050.Op Fl nomaciter
3910.Op Fl nomacver 4051.Op Fl nomacver
3911.Op Fl noout 4052.Op Fl noout
@@ -3915,10 +4056,12 @@ compatibility, several of the utilities use the old format at present.
3915.Op Fl caname Ar name 4056.Op Fl caname Ar name
3916.Op Fl certfile Ar file 4057.Op Fl certfile Ar file
3917.Op Fl certpbe Ar alg 4058.Op Fl certpbe Ar alg
4059.Op Fl CSP Ar name
3918.Op Fl engine Ar id 4060.Op Fl engine Ar id
3919.Op Fl in Ar file 4061.Op Fl in Ar file
3920.Op Fl inkey Ar file 4062.Op Fl inkey Ar file
3921.Op Fl keypbe Ar alg 4063.Op Fl keypbe Ar alg
4064.Op Fl macalg Ar alg
3922.Op Fl name Ar name 4065.Op Fl name Ar name
3923.Op Fl out Ar file 4066.Op Fl out Ar file
3924.Op Fl passin Ar arg 4067.Op Fl passin Ar arg
@@ -4004,11 +4147,13 @@ PKCS#12 files unreadable.
4004.Sh PKCS12 FILE CREATION OPTIONS 4147.Sh PKCS12 FILE CREATION OPTIONS
4005.Bl -tag -width "XXXX" 4148.Bl -tag -width "XXXX"
4006.It Fl CAfile Ar file 4149.It Fl CAfile Ar file
4007File of CAs 4150CA storage as a file.
4008.Pq PEM format .
4009.It Fl CApath Ar directory 4151.It Fl CApath Ar directory
4010Directory of CAs 4152CA storage as a directory.
4011.Pq PEM format . 4153This directory must be a standard certificate directory:
4154that is, a hash of each subject name (using
4155.Cm x509 -hash )
4156should be linked to each certificate.
4012.It Fl caname Ar name 4157.It Fl caname Ar name
4013This specifies the 4158This specifies the
4014.Qq friendly name 4159.Qq friendly name
@@ -4022,16 +4167,24 @@ A file to read additional certificates from.
4022.It Fl certpbe Ar alg , Fl keypbe Ar alg 4167.It Fl certpbe Ar alg , Fl keypbe Ar alg
4023These options allow the algorithm used to encrypt the private key and 4168These options allow the algorithm used to encrypt the private key and
4024certificates to be selected. 4169certificates to be selected.
4025Although any PKCS#5 v1.5 or PKCS#12 algorithms can be selected, 4170Any PKCS#5 v1.5 or PKCS#12 PBE algorithm name can be used (see the
4026it is advisable to only use PKCS#12 algorithms.
4027See the list in the
4028.Sx PKCS12 NOTES 4171.Sx PKCS12 NOTES
4029section for more information. 4172section for more information).
4173If a a cipher name
4174(as output by the
4175.Cm list-cipher-algorithms
4176command) is specified then it
4177is used with PKCS#5 v2.0.
4178For interoperability reasons it is advisable to only use PKCS#12 algorithms.
4030.It Fl chain 4179.It Fl chain
4031If this option is present, an attempt is made to include the entire 4180If this option is present, an attempt is made to include the entire
4032certificate chain of the user certificate. 4181certificate chain of the user certificate.
4033The standard CA store is used for this search. 4182The standard CA store is used for this search.
4034If the search fails, it is considered a fatal error. 4183If the search fails, it is considered a fatal error.
4184.It Fl CSP Ar name
4185Write
4186.Ar name
4187as a Microsoft CSP name.
4035.It Fl descert 4188.It Fl descert
4036Encrypt the certificate using triple DES; this may render the PKCS#12 4189Encrypt the certificate using triple DES; this may render the PKCS#12
4037file unreadable by some 4190file unreadable by some
@@ -4040,7 +4193,7 @@ software.
4040By default, the private key is encrypted using triple DES and the 4193By default, the private key is encrypted using triple DES and the
4041certificate using 40-bit RC2. 4194certificate using 40-bit RC2.
4042.It Fl engine Ar id 4195.It Fl engine Ar id
4043Specifying an engine (by it's unique 4196Specifying an engine (by its unique
4044.Ar id 4197.Ar id
4045string) will cause 4198string) will cause
4046.Nm pkcs12 4199.Nm pkcs12
@@ -4077,6 +4230,9 @@ Signing only keys can be used for S/MIME signing, authenticode
4077and SSL client authentication; 4230and SSL client authentication;
4078however, due to a bug only MSIE 5.0 and later support 4231however, due to a bug only MSIE 5.0 and later support
4079the use of signing only keys for SSL client authentication. 4232the use of signing only keys for SSL client authentication.
4233.It Fl macalg Ar alg
4234Specify the MAC digest algorithm.
4235If not included then SHA1 is used.
4080.It Fl maciter 4236.It Fl maciter
4081This option is included for compatibility with previous versions; it used 4237This option is included for compatibility with previous versions; it used
4082to be needed to use MAC iterations counts but they are now used by default. 4238to be needed to use MAC iterations counts but they are now used by default.
@@ -4085,6 +4241,8 @@ This specifies the
4085.Qq friendly name 4241.Qq friendly name
4086for the certificate and private key. 4242for the certificate and private key.
4087This name is typically displayed in list boxes by software importing the file. 4243This name is typically displayed in list boxes by software importing the file.
4244.It Fl nomac
4245Don't attempt to provide the MAC integrity.
4088.It Fl nomaciter , noiter 4246.It Fl nomaciter , noiter
4089These options affect the iteration counts on the MAC and key algorithms. 4247These options affect the iteration counts on the MAC and key algorithms.
4090Unless you wish to produce files compatible with MSIE 4.0, you should leave 4248Unless you wish to produce files compatible with MSIE 4.0, you should leave
@@ -4289,7 +4447,7 @@ Perform
4289.Em base64 4447.Em base64
4290encoding on the output. 4448encoding on the output.
4291.It Fl engine Ar id 4449.It Fl engine Ar id
4292Specifying an engine (by it's unique 4450Specifying an engine (by its unique
4293.Ar id 4451.Ar id
4294string) will cause 4452string) will cause
4295.Nm rand 4453.Nm rand
@@ -4317,10 +4475,11 @@ Multiple files can be specified separated by a
4317.Bk -words 4475.Bk -words
4318.Op Fl asn1-kludge 4476.Op Fl asn1-kludge
4319.Op Fl batch 4477.Op Fl batch
4320.Op Fl md2 | md4 | md5 | sha1 4478.Op Fl md4 | md5 | sha1
4321.Op Fl modulus 4479.Op Fl modulus
4322.Op Fl new 4480.Op Fl new
4323.Op Fl newhdr 4481.Op Fl newhdr
4482.Op Fl no-asn1-kludge
4324.Op Fl nodes 4483.Op Fl nodes
4325.Op Fl noout 4484.Op Fl noout
4326.Op Fl pubkey 4485.Op Fl pubkey
@@ -4340,16 +4499,7 @@ Multiple files can be specified separated by a
4340.Op Fl keyform Ar DER | PEM 4499.Op Fl keyform Ar DER | PEM
4341.Op Fl keyout Ar file 4500.Op Fl keyout Ar file
4342.Op Fl nameopt Ar option 4501.Op Fl nameopt Ar option
4343.Oo Xo 4502.Op Fl newkey Ar arg
4344.Fl newkey
4345.Ar dsa : Ns Ar file
4346.Xc
4347.Oc
4348.Oo Xo
4349.Fl newkey
4350.Ar rsa : Ns Ar bits
4351.Xc
4352.Oc
4353.Op Fl out Ar file 4503.Op Fl out Ar file
4354.Op Fl outform Ar DER | PEM 4504.Op Fl outform Ar DER | PEM
4355.Op Fl passin Ar arg 4505.Op Fl passin Ar arg
@@ -4405,7 +4555,7 @@ option is being used, this specifies the number of
4405days to certify the certificate for. 4555days to certify the certificate for.
4406The default is 30 days. 4556The default is 30 days.
4407.It Fl engine Ar id 4557.It Fl engine Ar id
4408Specifying an engine (by it's unique 4558Specifying an engine (by its unique
4409.Ar id 4559.Ar id
4410string) will cause 4560string) will cause
4411.Nm req 4561.Nm req
@@ -4455,10 +4605,14 @@ This gives the
4455to write the newly created private key to. 4605to write the newly created private key to.
4456If this option is not specified, the filename present in the 4606If this option is not specified, the filename present in the
4457configuration file is used. 4607configuration file is used.
4458.It Fl md2 | md4 | md5 | sha1 4608.It Fl md4 | md5 | sha1
4459This specifies the message digest to sign the request with. 4609This specifies the message digest to sign the request with.
4460This overrides the digest algorithm specified in the configuration file. 4610This overrides the digest algorithm specified in the configuration file.
4461This option is ignored for DSA requests: they always use SHA1. 4611.Pp
4612Some public key algorithms may override this choice.
4613For instance, DSA signatures always use SHA1;
4614GOST R 34.10 signatures always use GOST R 34.11-94
4615.Pq Fl md_gost94 .
4462.It Fl modulus 4616.It Fl modulus
4463This option prints out the value of the modulus of the public key 4617This option prints out the value of the modulus of the public key
4464contained in the request. 4618contained in the request.
@@ -4489,16 +4643,61 @@ Some software
4489and some CAs need this. 4643and some CAs need this.
4490.It Fl newkey Ar arg 4644.It Fl newkey Ar arg
4491This option creates a new certificate request and a new private key. 4645This option creates a new certificate request and a new private key.
4492The argument takes one of two forms: 4646The argument takes one of several forms.
4493.Ar rsa : Ns Ar nbits , 4647.Ar rsa : Ns Ar nbits ,
4494where 4648where
4495.Ar nbits 4649.Ar nbits
4496is the number of bits, generates an RSA key 4650is the number of bits, generates an RSA key
4497.Ar nbits 4651.Ar nbits
4498in size. 4652in size.
4499.Ar dsa : Ns Ar file 4653If
4654.Ar nbits
4655is omitted, i.e.\&
4656.Cm -newkey rsa
4657specified,
4658the default key size, specified in the configuration file, is used.
4659.Pp
4660All other algorithms support the
4661.Ar alg : Ns Ar file
4662form,
4663where file may be an algorithm parameter file,
4664created by the
4665.Cm genpkey -genparam
4666command or an X.509 certificate for a key with approriate algorithm.
4667.Pp
4668.Ar param : Ns Ar file
4669generates a key using the parameter file or certificate
4670.Ar file ;
4671the algorithm is determined by the parameters.
4672.Ar algname : Ns Ar file
4673use algorithm
4674.Ar algname
4675and parameter file
4676.Ar file :
4677the two algorithms must match or an error occurs.
4678.Ar algname
4679just uses algorithm
4680.Ar algname ,
4681and parameters, if necessary,
4682should be specified via the
4683.Fl pkeyopt
4684option.
4685.Pp
4686.Ar dsa : Ns Ar filename
4500generates a DSA key using the parameters in the file 4687generates a DSA key using the parameters in the file
4501.Ar file . 4688.Ar filename .
4689.Ar ec : Ns Ar filename
4690generates an EC key (usable both with ECDSA or ECDH algorithms);
4691.Ar gost2001 : Ns Ar filename
4692generates a GOST R 34.10-2001 key
4693(requires the ccgost engine configured in the configuration file).
4694If just
4695.Cm gost2001
4696is specified a parameter set should be specified by
4697.Cm -pkeyopt paramset:X .
4698.It Fl no-asn1-kludge
4699Reverses the effect of
4700.Fl asn1-kludge .
4502.It Fl nodes 4701.It Fl nodes
4503If this option is specified and a private key is created, it 4702If this option is specified and a private key is created, it
4504will not be encrypted. 4703will not be encrypted.
@@ -4534,22 +4733,36 @@ or an EGD socket (see
4534.Xr RAND_egd 3 ) . 4733.Xr RAND_egd 3 ) .
4535Multiple files can be specified separated by a 4734Multiple files can be specified separated by a
4536.Sq \&: . 4735.Sq \&: .
4736.It Fl reqopt Ar option
4737Customise the output format used with
4738.Fl text .
4739The
4740.Ar option
4741argument can be a single option or multiple options separated by commas.
4742.Pp
4743See the discussion of the
4744.Fl certopt
4745option in the
4746.Nm x509
4747command.
4537.It Fl set_serial Ar n 4748.It Fl set_serial Ar n
4538Serial number to use when outputting a self-signed certificate. 4749Serial number to use when outputting a self-signed certificate.
4539This may be specified as a decimal value or a hex value if preceded by 4750This may be specified as a decimal value or a hex value if preceded by
4540.Sq 0x . 4751.Sq 0x .
4541It is possible to use negative serial numbers but this is not recommended. 4752It is possible to use negative serial numbers but this is not recommended.
4542.It Fl subj Ar arg 4753.It Fl subj Ar arg
4543Sets subject name for new request or supersedes the subject name 4754Replaces subject field of input request with specified data and outputs
4544when processing a request. 4755modified request.
4545The arg must be formatted as 4756The arg must be formatted as
4546.Em /type0=value0/type1=value1/type2=... ; 4757.Em /type0=value0/type1=value1/type2=... ;
4547characters may be escaped by 4758characters may be escaped by
4548.Sq \e 4759.Sq \e
4549.Pq backslash , 4760.Pq backslash ;
4550no spaces are skipped. 4761no spaces are skipped.
4551.It Fl subject 4762.It Fl subject
4552Output the request's subject. 4763Prints out the request subject (or certificate subject if
4764.Fl x509
4765is specified.
4553.It Fl text 4766.It Fl text
4554Prints out the certificate request in text form. 4767Prints out the certificate request in text form.
4555.It Fl utf8 4768.It Fl utf8
@@ -5088,7 +5301,7 @@ These options can only be used with PEM format output files.
5088.It Fl check 5301.It Fl check
5089This option checks the consistency of an RSA private key. 5302This option checks the consistency of an RSA private key.
5090.It Fl engine Ar id 5303.It Fl engine Ar id
5091Specifying an engine (by it's unique 5304Specifying an engine (by its unique
5092.Ar id 5305.Ar id
5093string) will cause 5306string) will cause
5094.Nm rsa 5307.Nm rsa
@@ -5266,7 +5479,7 @@ Decrypt the input data using an RSA private key.
5266.It Fl encrypt 5479.It Fl encrypt
5267Encrypt the input data using an RSA public key. 5480Encrypt the input data using an RSA public key.
5268.It Fl engine Ar id 5481.It Fl engine Ar id
5269Specifying an engine (by it's unique 5482Specifying an engine (by its unique
5270.Ar id 5483.Ar id
5271string) will cause 5484string) will cause
5272.Nm rsautl 5485.Nm rsautl
@@ -5416,16 +5629,24 @@ which it can be seen agrees with the recovered value above.
5416.Bk -words 5629.Bk -words
5417.Op Fl 4 | 6 5630.Op Fl 4 | 6
5418.Op Fl bugs 5631.Op Fl bugs
5632.Op Fl check_ss_sig
5633.Op Fl crl_check
5634.Op Fl crl_check_all
5419.Op Fl crlf 5635.Op Fl crlf
5420.Op Fl debug 5636.Op Fl debug
5637.Op Fl extended_crl
5421.Op Fl ign_eof 5638.Op Fl ign_eof
5639.Op Fl ignore_critical
5640.Op Fl issuer_checks
5422.Op Fl msg 5641.Op Fl msg
5423.Op Fl nbio 5642.Op Fl nbio
5424.Op Fl nbio_test 5643.Op Fl nbio_test
5425.Op Fl no_ssl2 5644.Op Fl no_ssl2
5426.Op Fl no_ssl3 5645.Op Fl no_ssl3
5646.Op Fl no_ticket
5427.Op Fl no_tls1 5647.Op Fl no_tls1
5428.Op Fl pause 5648.Op Fl pause
5649.Op Fl policy_check
5429.Op Fl prexit 5650.Op Fl prexit
5430.Op Fl quiet 5651.Op Fl quiet
5431.Op Fl reconnect 5652.Op Fl reconnect
@@ -5435,6 +5656,8 @@ which it can be seen agrees with the recovered value above.
5435.Op Fl ssl3 5656.Op Fl ssl3
5436.Op Fl state 5657.Op Fl state
5437.Op Fl tls1 5658.Op Fl tls1
5659.Op Fl tlsextdebug
5660.Op Fl x509_strict
5438.Op Fl CAfile Ar file 5661.Op Fl CAfile Ar file
5439.Op Fl CApath Ar directory 5662.Op Fl CApath Ar directory
5440.Op Fl cert Ar file 5663.Op Fl cert Ar file
@@ -5445,6 +5668,8 @@ which it can be seen agrees with the recovered value above.
5445.Oc 5668.Oc
5446.Op Fl engine Ar id 5669.Op Fl engine Ar id
5447.Op Fl key Ar keyfile 5670.Op Fl key Ar keyfile
5671.Op Fl psk Ar key
5672.Op Fl psk_identity Ar identity
5448.Op Fl rand Ar 5673.Op Fl rand Ar
5449.Op Fl starttls Ar protocol 5674.Op Fl starttls Ar protocol
5450.Op Fl verify Ar depth 5675.Op Fl verify Ar depth
@@ -5489,6 +5714,20 @@ These are also used when building the client certificate chain.
5489.It Fl cert Ar file 5714.It Fl cert Ar file
5490The certificate to use, if one is requested by the server. 5715The certificate to use, if one is requested by the server.
5491The default is not to use a certificate. 5716The default is not to use a certificate.
5717.It Xo
5718.Fl check_ss_sig ,
5719.Fl crl_check ,
5720.Fl crl_check_all ,
5721.Fl extended_crl ,
5722.Fl ignore_critical ,
5723.Fl issuer_checks ,
5724.Fl policy_check ,
5725.Fl x509_strict
5726.Xc
5727Set various certificate chain validation options.
5728See the
5729.Nm VERIFY
5730command for details.
5492.It Fl cipher Ar cipherlist 5731.It Fl cipher Ar cipherlist
5493This allows the cipher list sent by the client to be modified. 5732This allows the cipher list sent by the client to be modified.
5494Although the server determines which cipher suite is used, it should take 5733Although the server determines which cipher suite is used, it should take
@@ -5516,7 +5755,7 @@ by some servers.
5516.It Fl debug 5755.It Fl debug
5517Print extensive debugging information including a hex dump of all traffic. 5756Print extensive debugging information including a hex dump of all traffic.
5518.It Fl engine Ar id 5757.It Fl engine Ar id
5519Specifying an engine (by it's unique 5758Specifying an engine (by its unique
5520.Ar id 5759.Ar id
5521string) will cause 5760string) will cause
5522.Nm s_client 5761.Nm s_client
@@ -5550,6 +5789,8 @@ Some servers only work if TLS is turned off with the
5550option, others will only support SSL v2 and may need the 5789option, others will only support SSL v2 and may need the
5551.Fl ssl2 5790.Fl ssl2
5552option. 5791option.
5792.It Fl no_ticket
5793Disable RFC 4507 session ticket support.
5553.It Fl pause 5794.It Fl pause
5554Pauses 1 second between each read and write call. 5795Pauses 1 second between each read and write call.
5555.It Fl prexit 5796.It Fl prexit
@@ -5563,6 +5804,16 @@ requested only after an attempt is made to access a certain URL.
5563.Sy Note : 5804.Sy Note :
5564the output produced by this option is not always accurate because a 5805the output produced by this option is not always accurate because a
5565connection might never have been established. 5806connection might never have been established.
5807.It Fl psk Ar key
5808Use the PSK key
5809.Ar key
5810when using a PSK cipher suite.
5811The key is given as a hexadecimal number without the leading 0x,
5812for example -psk 1a2b3c4d.
5813.It Fl psk_identity Ar identity
5814Use the PSK identity
5815.Ar identity
5816when using a PSK cipher suite.
5566.It Fl quiet 5817.It Fl quiet
5567Inhibit printing of session and certificate information. 5818Inhibit printing of session and certificate information.
5568This implicitly turns on 5819This implicitly turns on
@@ -5596,6 +5847,8 @@ and
5596.Qq xmpp . 5847.Qq xmpp .
5597.It Fl state 5848.It Fl state
5598Prints out the SSL session states. 5849Prints out the SSL session states.
5850.It Fl tlsextdebug
5851Print out a hex dump of any TLS extensions received from the server.
5599.It Fl verify Ar depth 5852.It Fl verify Ar depth
5600The verify 5853The verify
5601.Ar depth 5854.Ar depth
@@ -5733,6 +5986,8 @@ We should really report information whenever a session is renegotiated.
5733.Op Fl id_prefix Ar arg 5986.Op Fl id_prefix Ar arg
5734.Op Fl key Ar keyfile 5987.Op Fl key Ar keyfile
5735.Op Fl rand Ar 5988.Op Fl rand Ar
5989.Op Fl psk Ar key
5990.Op Fl psk_hint Ar hint
5736.Op Fl Verify Ar depth 5991.Op Fl Verify Ar depth
5737.Op Fl verify Ar depth 5992.Op Fl verify Ar depth
5738.Ek 5993.Ek
@@ -5826,7 +6081,7 @@ If this fails, a static set of parameters hard coded into the
5826.Nm s_server 6081.Nm s_server
5827program will be used. 6082program will be used.
5828.It Fl engine Ar id 6083.It Fl engine Ar id
5829Specifying an engine (by it's unique 6084Specifying an engine (by its unique
5830.Ar id 6085.Ar id
5831string) will cause 6086string) will cause
5832.Nm s_server 6087.Nm s_server
@@ -5882,6 +6137,16 @@ disables temporary RSA key generation.
5882If this option is set, no certificate is used. 6137If this option is set, no certificate is used.
5883This restricts the cipher suites available to the anonymous ones 6138This restricts the cipher suites available to the anonymous ones
5884.Pq currently just anonymous DH . 6139.Pq currently just anonymous DH .
6140.It Fl psk Ar key
6141Use the PSK key
6142.Ar key
6143when using a PSK cipher suite.
6144The key is given as a hexadecimal number without the leading 0x,
6145for example -psk 1a2b3c4d.
6146.It Fl psk_hint Ar hint
6147Use the PSK identity hint
6148.Ar hint
6149when using a PSK cipher suite.
5885.It Fl quiet 6150.It Fl quiet
5886Inhibit printing of session and certificate information. 6151Inhibit printing of session and certificate information.
5887.It Fl rand Ar 6152.It Fl rand Ar
@@ -6320,21 +6585,31 @@ The cipher and start time should be printed out in human readable form.
6320.Xc 6585.Xc
6321.Oc 6586.Oc
6322.Op Fl binary 6587.Op Fl binary
6588.Op Fl check_ss_sig
6323.Op Fl crl_check 6589.Op Fl crl_check
6324.Op Fl crl_check_all 6590.Op Fl crl_check_all
6325.Op Fl decrypt 6591.Op Fl decrypt
6326.Op Fl encrypt 6592.Op Fl encrypt
6593.Op Fl extended_crl
6594.Op Fl ignore_critical
6595.Op Fl indef
6596.Op Fl issuer_checks
6327.Op Fl noattr 6597.Op Fl noattr
6328.Op Fl nocerts 6598.Op Fl nocerts
6329.Op Fl nochain 6599.Op Fl nochain
6330.Op Fl nodetach 6600.Op Fl nodetach
6601.Op Fl noindef
6331.Op Fl nointern 6602.Op Fl nointern
6332.Op Fl nosigs 6603.Op Fl nosigs
6333.Op Fl noverify 6604.Op Fl noverify
6334.Op Fl pk7out 6605.Op Fl pk7out
6606.Op Fl policy_check
6607.Op Fl resign
6335.Op Fl sign 6608.Op Fl sign
6609.Op Fl stream
6336.Op Fl text 6610.Op Fl text
6337.Op Fl verify 6611.Op Fl verify
6612.Op Fl x509_strict
6338.Op Fl CAfile Ar file 6613.Op Fl CAfile Ar file
6339.Op Fl CApath Ar directory 6614.Op Fl CApath Ar directory
6340.Op Fl certfile Ar file 6615.Op Fl certfile Ar file
@@ -6345,6 +6620,7 @@ The cipher and start time should be printed out in human readable form.
6345.Op Fl inform Ar DER | PEM | SMIME 6620.Op Fl inform Ar DER | PEM | SMIME
6346.Op Fl inkey Ar file 6621.Op Fl inkey Ar file
6347.Op Fl keyform Ar ENGINE | PEM 6622.Op Fl keyform Ar ENGINE | PEM
6623.Op Fl md Ar digest
6348.Op Fl out Ar file 6624.Op Fl out Ar file
6349.Op Fl outform Ar DER | PEM | SMIME 6625.Op Fl outform Ar DER | PEM | SMIME
6350.Op Fl passin Ar arg 6626.Op Fl passin Ar arg
@@ -6365,10 +6641,10 @@ It can encrypt, decrypt, sign, and verify
6365.Em S/MIME 6641.Em S/MIME
6366messages. 6642messages.
6367.Pp 6643.Pp
6368There are five operation options that set the type of operation to be performed. 6644There are six operation options that set the type of operation to be performed.
6369The meaning of the other options varies according to the operation type. 6645The meaning of the other options varies according to the operation type.
6370.Pp 6646.Pp
6371The five operation options are as follows: 6647The six operation options are as follows:
6372.Bl -tag -width "XXXX" 6648.Bl -tag -width "XXXX"
6373.It Fl decrypt 6649.It Fl decrypt
6374Decrypt mail using the supplied certificate and private key. 6650Decrypt mail using the supplied certificate and private key.
@@ -6384,6 +6660,8 @@ The output file is the encrypted mail in
6384format. 6660format.
6385.It Fl pk7out 6661.It Fl pk7out
6386Takes an input message and writes out a PEM-encoded PKCS#7 structure. 6662Takes an input message and writes out a PEM-encoded PKCS#7 structure.
6663.It Fl resign
6664Resign a message: take an existing message and one or more new signers.
6387.It Fl sign 6665.It Fl sign
6388Sign mail using the supplied certificate and private key. 6666Sign mail using the supplied certificate and private key.
6389Input file is the message to be signed. 6667Input file is the message to be signed.
@@ -6446,6 +6724,20 @@ Allows additional certificates to be specified.
6446When signing, these will be included with the message. 6724When signing, these will be included with the message.
6447When verifying, these will be searched for the signers' certificates. 6725When verifying, these will be searched for the signers' certificates.
6448The certificates should be in PEM format. 6726The certificates should be in PEM format.
6727.It Xo
6728.Fl check_ss_sig ,
6729.Fl crl_check ,
6730.Fl crl_check_all ,
6731.Fl extended_crl ,
6732.Fl ignore_critical ,
6733.Fl issuer_checks ,
6734.Fl policy_check ,
6735.Fl x509_strict
6736.Xc
6737Set various certificate chain validation options.
6738See the
6739.Nm VERIFY
6740command for details.
6449.It Fl content Ar file 6741.It Fl content Ar file
6450This specifies a file containing the detached content. 6742This specifies a file containing the detached content.
6451This is only useful with the 6743This is only useful with the
@@ -6458,12 +6750,8 @@ This option will override any content if the input format is
6458and it uses the multipart/signed 6750and it uses the multipart/signed
6459.Em MIME 6751.Em MIME
6460content type. 6752content type.
6461.It Fl crl_check
6462Check revocation status of signer's certificate using CRLs.
6463.It Fl crl_check_all
6464Check revocation status of signer's certificate chain using CRLs.
6465.It Fl engine Ar id 6753.It Fl engine Ar id
6466Specifying an engine (by it's unique 6754Specifying an engine (by its unique
6467.Ar id 6755.Ar id
6468string) will cause 6756string) will cause
6469.Nm smime 6757.Nm smime
@@ -6488,6 +6776,14 @@ The input message to be encrypted or signed or the
6488.Em MIME 6776.Em MIME
6489message to 6777message to
6490be decrypted or verified. 6778be decrypted or verified.
6779.It Fl indef
6780Enable streaming I/O for encoding operations.
6781This permits single pass processing of data without
6782the need to hold the entire contents in memory,
6783potentially supporting very large files.
6784Streaming is automatically set for S/MIME signing with detached
6785data if the output format is SMIME;
6786it is currently off by default for all other operations.
6491.It Fl inform Ar DER | PEM | SMIME 6787.It Fl inform Ar DER | PEM | SMIME
6492This specifies the input format for the PKCS#7 structure. 6788This specifies the input format for the PKCS#7 structure.
6493The default is 6789The default is
@@ -6516,8 +6812,14 @@ the
6516or 6812or
6517.Fl signer 6813.Fl signer
6518file. 6814file.
6815When signing,
6816this option can be used multiple times to specify successive keys.
6519.It Fl keyform Ar ENGINE | PEM 6817.It Fl keyform Ar ENGINE | PEM
6520Input private key format. 6818Input private key format.
6819.It Fl md Ar digest
6820The digest algorithm to use when signing or resigning.
6821If not present then the default digest algorithm for the signing key is used
6822(usually SHA1).
6521.It Fl noattr 6823.It Fl noattr
6522Normally, when a message is signed a set of attributes are included which 6824Normally, when a message is signed a set of attributes are included which
6523include the signing time and supported symmetric algorithms. 6825include the signing time and supported symmetric algorithms.
@@ -6540,6 +6842,11 @@ do not support
6540Without this option cleartext signing with the 6842Without this option cleartext signing with the
6541.Em MIME 6843.Em MIME
6542type multipart/signed is used. 6844type multipart/signed is used.
6845.It Fl noindef
6846Disable streaming I/O where it would produce an encoding of indefinite length.
6847This option currently has no effect.
6848In future streaming will be enabled by default on all relevant operations
6849and this option will disable it.
6543.It Fl nointern 6850.It Fl nointern
6544When verifying a message, normally certificates 6851When verifying a message, normally certificates
6545.Pq if any 6852.Pq if any
@@ -6593,9 +6900,13 @@ The recipients certificate when decrypting a message.
6593This certificate 6900This certificate
6594must match one of the recipients of the message or an error occurs. 6901must match one of the recipients of the message or an error occurs.
6595.It Fl signer Ar file 6902.It Fl signer Ar file
6596The signer's certificate when signing a message. 6903A signing certificate when signing or resigning a message;
6904this option can be used multiple times if more than one signer is required.
6597If a message is being verified, the signer's certificates will be 6905If a message is being verified, the signer's certificates will be
6598written to this file if the verification was successful. 6906written to this file if the verification was successful.
6907.It Fl stream
6908The same as
6909.Fl indef .
6599.It Fl text 6910.It Fl text
6600This option adds plain text 6911This option adds plain text
6601.Pq text/plain 6912.Pq text/plain
@@ -6652,6 +6963,31 @@ reflect common usage in
6652clients. 6963clients.
6653Strictly speaking these process PKCS#7 enveloped data: PKCS#7 6964Strictly speaking these process PKCS#7 enveloped data: PKCS#7
6654encrypted data is used for other purposes. 6965encrypted data is used for other purposes.
6966.Pp
6967The
6968.Fl resign
6969option uses an existing message digest when adding a new signer.
6970This means that attributes must be present in at least one existing
6971signer using the same message digest or this operation will fail.
6972.Pp
6973The
6974.Fl stream
6975and
6976.Fl indef
6977options enable experimental streaming I/O support.
6978As a result the encoding is BER using indefinite length constructed encoding
6979and no longer DER.
6980Streaming is supported for the
6981.Fl encrypt
6982and
6983.Fl sign
6984operations if the content is not detached.
6985.Pp
6986Streaming is always used for the
6987.Fl sign
6988operation with detached data
6989but since the content is no longer part of the PKCS#7 structure
6990the encoding remains DER.
6655.Sh SMIME EXIT CODES 6991.Sh SMIME EXIT CODES
6656.Bl -tag -width "XXXX" 6992.Bl -tag -width "XXXX"
6657.It Ar 0 6993.It Ar 0
@@ -6690,6 +7026,12 @@ $ openssl smime -sign -in in.txt -text -out mail.msg \e
6690 -signer mycert.pem -inkey mykey.pem -certfile mycerts.pem 7026 -signer mycert.pem -inkey mykey.pem -certfile mycerts.pem
6691.Ed 7027.Ed
6692.Pp 7028.Pp
7029Create a signed message with two signers:
7030.Bd -literal -offset indent
7031openssl smime -sign -in message.txt -text -out mail.msg \e
7032 -signer mycert.pem -signer othercert.pem
7033.Ed
7034.Pp
6693Send a signed message under 7035Send a signed message under
6694.Ux 7036.Ux
6695directly to 7037directly to
@@ -6755,6 +7097,18 @@ Alternatively, you can base64 decode the signature and use:
6755$ openssl smime -verify -inform DER -in signature.der \e 7097$ openssl smime -verify -inform DER -in signature.der \e
6756 -content content.txt 7098 -content content.txt
6757.Ed 7099.Ed
7100.Pp
7101Create an encrypted message using 128-bit AES:
7102.Bd -literal -offset indent
7103openssl smime -encrypt -in plain.txt -aes128 \e
7104 -out mail.msg cert.pem
7105.Ed
7106.Pp
7107Add a signer to an existing message:
7108.Bd -literal -offset indent
7109openssl smime -resign -in mail.msg -signer newsign.pem \e
7110 -out mail2.msg
7111.Ed
6758.Sh SMIME BUGS 7112.Sh SMIME BUGS
6759The 7113The
6760.Em MIME 7114.Em MIME
@@ -6784,6 +7138,14 @@ The current code can only handle
6784v2 messages; the more complex 7138v2 messages; the more complex
6785.Em S/MIME 7139.Em S/MIME
6786v3 structures may cause parsing errors. 7140v3 structures may cause parsing errors.
7141.Sh SMIME HISTORY
7142The use of multiple
7143.Fl signer
7144options and the
7145.Fl resign
7146command were first added in
7147.Nm OpenSSL
71481.0.0.
6787.\" 7149.\"
6788.\" SPEED 7150.\" SPEED
6789.\" 7151.\"
@@ -6839,7 +7201,7 @@ tests those algorithms, otherwise all of the above are tested.
6839Time decryption instead of encryption 7201Time decryption instead of encryption
6840.Pq only EVP . 7202.Pq only EVP .
6841.It Fl engine Ar id 7203.It Fl engine Ar id
6842Specifying an engine (by it's unique 7204Specifying an engine (by its unique
6843.Ar id 7205.Ar id
6844string) will cause 7206string) will cause
6845.Nm speed 7207.Nm speed
@@ -6891,7 +7253,7 @@ The options are as follows:
6891.It Fl challenge Ar string 7253.It Fl challenge Ar string
6892Specifies the challenge string if an SPKAC is being created. 7254Specifies the challenge string if an SPKAC is being created.
6893.It Fl engine Ar id 7255.It Fl engine Ar id
6894Specifying an engine (by it's unique 7256Specifying an engine (by its unique
6895.Ar id 7257.Ar id
6896string) will cause 7258string) will cause
6897.Nm spkac 7259.Nm spkac
@@ -6991,10 +7353,19 @@ to be used in a
6991.Sh VERIFY 7353.Sh VERIFY
6992.Nm openssl verify 7354.Nm openssl verify
6993.Bk -words 7355.Bk -words
7356.Op Fl check_ss_sig
6994.Op Fl crl_check 7357.Op Fl crl_check
7358.Op Fl crl_check_all
7359.Op Fl explicit_policy
7360.Op Fl extended_crl
6995.Op Fl help 7361.Op Fl help
7362.Op Fl ignore_critical
7363.Op Fl inhibit_any
7364.Op Fl inhibit_map
6996.Op Fl issuer_checks 7365.Op Fl issuer_checks
7366.Op Fl policy_check
6997.Op Fl verbose 7367.Op Fl verbose
7368.Op Fl x509_strict
6998.Op Fl CAfile Ar file 7369.Op Fl CAfile Ar file
6999.Op Fl CApath Ar directory 7370.Op Fl CApath Ar directory
7000.Op Fl engine Ar id 7371.Op Fl engine Ar id
@@ -7010,6 +7381,17 @@ command verifies certificate chains.
7010.Pp 7381.Pp
7011The options are as follows: 7382The options are as follows:
7012.Bl -tag -width "XXXX" 7383.Bl -tag -width "XXXX"
7384.It Fl check_ss_sig
7385Verify the signature on the self-signed root CA.
7386This is disabled by default
7387because it doesn't add any security.
7388.It Fl CAfile Ar file
7389A
7390.Ar file
7391of trusted certificates.
7392The
7393.Ar file
7394should contain multiple certificates in PEM format, concatenated together.
7013.It Fl CApath Ar directory 7395.It Fl CApath Ar directory
7014A 7396A
7015.Ar directory 7397.Ar directory
@@ -7027,20 +7409,46 @@ Under
7027the 7409the
7028.Nm c_rehash 7410.Nm c_rehash
7029script will automatically create symbolic links to a directory of certificates. 7411script will automatically create symbolic links to a directory of certificates.
7030.It Fl CAfile Ar file 7412.It Fl crl_check
7031A 7413Checks end entity certificate validity by attempting to look up a valid CRL.
7032.Ar file 7414If a valid CRL cannot be found an error occurs.
7033of trusted certificates. 7415.It Fl crl_check_all
7034The 7416Checks the validity of all certificates in the chain by attempting
7035.Ar file 7417to look up valid CRLs.
7036should contain multiple certificates in PEM format, concatenated together. 7418.It Fl engine Ar id
7037.It Fl untrusted Ar file 7419Specifying an engine (by its unique
7038A 7420.Ar id
7039.Ar file 7421string) will cause
7040of untrusted certificates. 7422.Nm verify
7041The 7423to attempt to obtain a functional reference to the specified engine,
7042.Ar file 7424thus initialising it if needed.
7043should contain multiple certificates. 7425The engine will then be set as the default for all available algorithms.
7426.It Fl explicit_policy
7427Set policy variable require-explicit-policy (see RFC 3280 et al).
7428.It Fl extended_crl
7429Enable extended CRL features such as indirect CRLs and alternate CRL
7430signing keys.
7431.It Fl help
7432Prints out a usage message.
7433.It Fl ignore_critical
7434Normally if an unhandled critical extension is present which is not
7435supported by
7436.Nm OpenSSL ,
7437the certificate is rejected (as required by RFC 3280 et al).
7438If this option is set, critical extensions are ignored.
7439.It Fl inhibit_any
7440Set policy variable inhibit-any-policy (see RFC 3280 et al).
7441.It Fl inhibit_map
7442Set policy variable inhibit-policy-mapping (see RFC 3280 et al).
7443.It Fl issuer_checks
7444Print out diagnostics relating to searches for the issuer certificate
7445of the current certificate.
7446This shows why each candidate issuer certificate was rejected.
7447However the presence of rejection messages
7448does not itself imply that anything is wrong: during the normal
7449verify process several rejections may take place.
7450.It Fl policy_check
7451Enables certificate policy processing.
7044.It Fl purpose Ar purpose 7452.It Fl purpose Ar purpose
7045The intended use for the certificate. 7453The intended use for the certificate.
7046Without this option no chain verification will be done. 7454Without this option no chain verification will be done.
@@ -7054,27 +7462,18 @@ and
7054See the 7462See the
7055.Sx VERIFY OPERATION 7463.Sx VERIFY OPERATION
7056section for more information. 7464section for more information.
7057.It Fl help 7465.It Fl untrusted Ar file
7058Prints out a usage message. 7466A
7467.Ar file
7468of untrusted certificates.
7469The
7470.Ar file
7471should contain multiple certificates.
7059.It Fl verbose 7472.It Fl verbose
7060Print extra information about the operations being performed. 7473Print extra information about the operations being performed.
7061.It Fl issuer_checks 7474.It Fl x509_strict
7062Print out diagnostics relating to searches for the issuer certificate 7475Disable workarounds for broken certificates which have to be disabled
7063of the current certificate. 7476for strict X.509 compliance.
7064This shows why each candidate issuer certificate was rejected.
7065However the presence of rejection messages
7066does not itself imply that anything is wrong: during the normal
7067verify process several rejections may take place.
7068.It Fl crl_check
7069Check revocation status of signer's certificate using CRLs.
7070.It Fl engine Ar id
7071Specifying an engine (by it's unique
7072.Ar id
7073string) will cause
7074.Nm verify
7075to attempt to obtain a functional reference to the specified engine,
7076thus initialising it if needed.
7077The engine will then be set as the default for all available algorithms.
7078.It Fl 7477.It Fl
7079Marks the last option. 7478Marks the last option.
7080All arguments following this are assumed to be certificate files. 7479All arguments following this are assumed to be certificate files.
@@ -7203,7 +7602,6 @@ The issuer certificate could not be found: this occurs if the issuer certificate
7203of an untrusted certificate cannot be found. 7602of an untrusted certificate cannot be found.
7204.It Ar 3 X509_V_ERR_UNABLE_TO_GET_CRL: unable to get certificate CRL 7603.It Ar 3 X509_V_ERR_UNABLE_TO_GET_CRL: unable to get certificate CRL
7205The CRL of a certificate could not be found. 7604The CRL of a certificate could not be found.
7206Unused.
7207.It Ar 4 X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: unable to decrypt certificate's signature 7605.It Ar 4 X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: unable to decrypt certificate's signature
7208The certificate signature could not be decrypted. 7606The certificate signature could not be decrypted.
7209This means that the actual signature value could not be determined rather 7607This means that the actual signature value could not be determined rather
@@ -7222,7 +7620,6 @@ could not be read.
7222The signature of the certificate is invalid. 7620The signature of the certificate is invalid.
7223.It Ar 8 X509_V_ERR_CRL_SIGNATURE_FAILURE: CRL signature failure 7621.It Ar 8 X509_V_ERR_CRL_SIGNATURE_FAILURE: CRL signature failure
7224The signature of the certificate is invalid. 7622The signature of the certificate is invalid.
7225Unused.
7226.It Ar 9 X509_V_ERR_CERT_NOT_YET_VALID: certificate is not yet valid 7623.It Ar 9 X509_V_ERR_CERT_NOT_YET_VALID: certificate is not yet valid
7227The certificate is not yet valid: the 7624The certificate is not yet valid: the
7228.Em notBefore 7625.Em notBefore
@@ -7233,10 +7630,8 @@ The certificate has expired; that is, the
7233date is before the current time. 7630date is before the current time.
7234.It Ar 11 X509_V_ERR_CRL_NOT_YET_VALID: CRL is not yet valid 7631.It Ar 11 X509_V_ERR_CRL_NOT_YET_VALID: CRL is not yet valid
7235The CRL is not yet valid. 7632The CRL is not yet valid.
7236Unused.
7237.It Ar 12 X509_V_ERR_CRL_HAS_EXPIRED: CRL has expired 7633.It Ar 12 X509_V_ERR_CRL_HAS_EXPIRED: CRL has expired
7238The CRL has expired. 7634The CRL has expired.
7239Unused.
7240.It Ar 13 X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: format error in certificate's notBefore field 7635.It Ar 13 X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: format error in certificate's notBefore field
7241The certificate 7636The certificate
7242.Em notBefore 7637.Em notBefore
@@ -7249,12 +7644,10 @@ field contains an invalid time.
7249The CRL 7644The CRL
7250.Em lastUpdate 7645.Em lastUpdate
7251field contains an invalid time. 7646field contains an invalid time.
7252Unused.
7253.It Ar 16 X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: format error in CRL's nextUpdate field 7647.It Ar 16 X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: format error in CRL's nextUpdate field
7254The CRL 7648The CRL
7255.Em nextUpdate 7649.Em nextUpdate
7256field contains an invalid time. 7650field contains an invalid time.
7257Unused.
7258.It Ar 17 X509_V_ERR_OUT_OF_MEM: out of memory 7651.It Ar 17 X509_V_ERR_OUT_OF_MEM: out of memory
7259An error occurred trying to allocate memory. 7652An error occurred trying to allocate memory.
7260This should never happen. 7653This should never happen.
@@ -7275,7 +7668,6 @@ The certificate chain length is greater than the supplied maximum depth.
7275Unused. 7668Unused.
7276.It Ar 23 X509_V_ERR_CERT_REVOKED: certificate revoked 7669.It Ar 23 X509_V_ERR_CERT_REVOKED: certificate revoked
7277The certificate has been revoked. 7670The certificate has been revoked.
7278Unused.
7279.It Ar 24 X509_V_ERR_INVALID_CA: invalid CA certificate 7671.It Ar 24 X509_V_ERR_INVALID_CA: invalid CA certificate
7280A CA certificate is invalid. 7672A CA certificate is invalid.
7281Either it is not a CA or its extensions are not consistent 7673Either it is not a CA or its extensions are not consistent
@@ -7397,10 +7789,12 @@ option was added in
7397.Op Fl hash 7789.Op Fl hash
7398.Op Fl issuer 7790.Op Fl issuer
7399.Op Fl issuer_hash 7791.Op Fl issuer_hash
7792.Op Fl issuer_hash_old
7400.Op Fl md2 | md5 | sha1 7793.Op Fl md2 | md5 | sha1
7401.Op Fl modulus 7794.Op Fl modulus
7402.Op Fl noout 7795.Op Fl noout
7403.Op Fl ocspid 7796.Op Fl ocspid
7797.Op Fl ocsp_uri
7404.Op Fl pubkey 7798.Op Fl pubkey
7405.Op Fl purpose 7799.Op Fl purpose
7406.Op Fl req 7800.Op Fl req
@@ -7408,6 +7802,7 @@ option was added in
7408.Op Fl startdate 7802.Op Fl startdate
7409.Op Fl subject 7803.Op Fl subject
7410.Op Fl subject_hash 7804.Op Fl subject_hash
7805.Op Fl subject_hash_old
7411.Op Fl text 7806.Op Fl text
7412.Op Fl trustout 7807.Op Fl trustout
7413.Op Fl x509toreq 7808.Op Fl x509toreq
@@ -7449,7 +7844,7 @@ various sections.
7449.Sh X509 INPUT, OUTPUT, AND GENERAL PURPOSE OPTIONS 7844.Sh X509 INPUT, OUTPUT, AND GENERAL PURPOSE OPTIONS
7450.Bl -tag -width "XXXX" 7845.Bl -tag -width "XXXX"
7451.It Fl engine Ar id 7846.It Fl engine Ar id
7452Specifying an engine (by it's unique 7847Specifying an engine (by its unique
7453.Ar id 7848.Ar id
7454string) will cause 7849string) will cause
7455.Nm x509 7850.Nm x509
@@ -7548,6 +7943,13 @@ Outputs the issuer name.
7548Outputs the 7943Outputs the
7549.Qq hash 7944.Qq hash
7550of the certificate issuer name. 7945of the certificate issuer name.
7946.It Fl issuer_hash_old
7947Outputs the
7948.Qq hash
7949of the certificate issuer name using the older algorithm
7950as used by
7951.Nm OpenSSL
7952versions before 1.0.0.
7551.It Fl modulus 7953.It Fl modulus
7552This option prints out the value of the modulus of the public key 7954This option prints out the value of the modulus of the public key
7553contained in the certificate. 7955contained in the certificate.
@@ -7566,6 +7968,8 @@ section for more information.
7566This option prevents output of the encoded version of the request. 7968This option prevents output of the encoded version of the request.
7567.It Fl ocspid 7969.It Fl ocspid
7568Print OCSP hash values for the subject name and public key. 7970Print OCSP hash values for the subject name and public key.
7971.It Fl ocsp_uri
7972Outputs the OCSP responder addresses, if any.
7569.It Fl pubkey 7973.It Fl pubkey
7570Output the public key. 7974Output the public key.
7571.It Fl serial 7975.It Fl serial
@@ -7584,6 +7988,13 @@ This is used in
7584.Nm OpenSSL 7988.Nm OpenSSL
7585to form an index to allow certificates in a directory to be looked up 7989to form an index to allow certificates in a directory to be looked up
7586by subject name. 7990by subject name.
7991.It Fl subject_hash_old
7992Outputs the
7993.Qq hash
7994of the certificate subject name using the older algorithm
7995as used by
7996.Nm OpenSSL
7997versions before 1.0.0.
7587.It Fl text 7998.It Fl text
7588Prints out the certificate in text form. 7999Prints out the certificate in text form.
7589Full details are output including the public key, signature algorithms, 8000Full details are output including the public key, signature algorithms,
@@ -8322,6 +8733,27 @@ It thus describes the intended behaviour rather than the current behaviour.
8322It is hoped that it will represent reality in 8733It is hoped that it will represent reality in
8323.Nm OpenSSL 8734.Nm OpenSSL
83240.9.5 and later. 87350.9.5 and later.
8736.Sh X509 HISTORY
8737Before
8738.Nm OpenSSL
87390.9.8,
8740the default digest for RSA keys was MD5.
8741.Pp
8742The hash algorithm used in the
8743.Fl subject_hash
8744and
8745.Fl issuer_hash
8746options before
8747.Nm OpenSSL
87481.0.0 was based on the deprecated MD5 algorithm and the encoding
8749of the distinguished name.
8750In
8751.Nm OpenSSL
87521.0.0 and later it is based on a canonical version of the DN using SHA1.
8753This means that any directories using the old form
8754must have their links rebuilt using
8755.Ar c_rehash
8756or similar.
8325.\" 8757.\"
8326.\" FILES 8758.\" FILES
8327.\" 8759.\"
@@ -8350,7 +8782,6 @@ certificates.
8350.Xr sendmail 8 , 8782.Xr sendmail 8 ,
8351.Xr ssl 8 , 8783.Xr ssl 8 ,
8352.Xr starttls 8 8784.Xr starttls 8
8353.Pp
8354.Rs 8785.Rs
8355.%T The SSL Protocol 8786.%T The SSL Protocol
8356.%Q Netscape Communications Corp. 8787.%Q Netscape Communications Corp.
@@ -8406,12 +8837,17 @@ document appeared in
8406.Nm OpenSSL 8837.Nm OpenSSL
84070.9.2. 88380.9.2.
8408The 8839The
8409.Cm list- Ns Ar XXX Ns Cm -commands 8840.Cm list- Ns XXX Ns Cm -commands
8410pseudo-commands were added in 8841pseudo-commands were added in
8411.Nm OpenSSL 8842.Nm OpenSSL
84120.9.3; 88430.9.3;
8413the 8844the
8414.Cm no- Ns Ar XXX 8845.Cm no- Ns XXX
8846pseudo-commands were added in
8847.Nm OpenSSL
88480.9.5a;
8849the
8850.Cm list- Ns XXX Ns Cm -algorithms
8415pseudo-commands were added in 8851pseudo-commands were added in
8416.Nm OpenSSL 8852.Nm OpenSSL
84170.9.5a. 88531.0.0.