summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjmc <>2004-01-28 19:25:19 +0000
committerjmc <>2004-01-28 19:25:19 +0000
commitd61047fa89127e2667e2b3c88155a99deb6b889b (patch)
tree805643b78c011cbfe7e11818800bce84d9a94648 /src
parentf5af420bc531180e9316cc8dcb135bde62aa03d7 (diff)
downloadopenbsd-d61047fa89127e2667e2b3c88155a99deb6b889b.tar.gz
openbsd-d61047fa89127e2667e2b3c88155a99deb6b889b.tar.bz2
openbsd-d61047fa89127e2667e2b3c88155a99deb6b889b.zip
update and sort openssl pkcs{7,8,12};
plus some consistency fixes;
Diffstat (limited to 'src')
-rw-r--r--src/usr.sbin/openssl/openssl.1717
1 files changed, 313 insertions, 404 deletions
diff --git a/src/usr.sbin/openssl/openssl.1 b/src/usr.sbin/openssl/openssl.1
index caf93d2e1b..318833ecc2 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.31 2004/01/25 20:27:37 jmc Exp $ 1.\" $OpenBSD: openssl.1,v 1.32 2004/01/28 19:25:19 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.\"
@@ -476,7 +476,7 @@ The input format.
476is binary format and 476is binary format and
477.Ar PEM 477.Ar PEM
478.Pq Privacy Enhanced Mail , 478.Pq Privacy Enhanced Mail ,
479the default, is base64 encoded. 479the default, is base64-encoded.
480.Ar TXT 480.Ar TXT
481is plain text. 481is plain text.
482.It Fl length Ar number 482.It Fl length Ar number
@@ -492,9 +492,7 @@ The format of this file is described in the
492.Sx ASN1PARSE NOTES 492.Sx ASN1PARSE NOTES
493section below. 493section below.
494.It Fl out Ar file 494.It Fl out Ar file
495Output file to place the 495Output file to place the DER-encoded data into.
496.Em DER
497encoded data into.
498If this option is not present, then no encoded data will be output. 496If this option is not present, then no encoded data will be output.
499This is most useful when combined with the 497This is most useful when combined with the
500.Fl strparse 498.Fl strparse
@@ -1696,11 +1694,7 @@ selection options were added in version 0.9.7.
1696.Pp 1694.Pp
1697The 1695The
1698.Nm crl 1696.Nm crl
1699command processes CRL files in 1697command processes CRL files in DER or PEM format.
1700.Ar DER
1701or
1702.Ar PEM
1703format.
1704.Pp 1698.Pp
1705The options are as follows: 1699The options are as follows:
1706.Bl -tag -width "XXXX" 1700.Bl -tag -width "XXXX"
@@ -1725,10 +1719,10 @@ option is not specified.
1725.It Fl inform Ar DER | PEM 1719.It Fl inform Ar DER | PEM
1726This specifies the input format. 1720This specifies the input format.
1727.Ar DER 1721.Ar DER
1728format is a DER encoded CRL structure. 1722format is a DER-encoded CRL structure.
1729.Ar PEM 1723.Ar PEM
1730.Pq the default 1724.Pq the default
1731is a base64 encoded version of the DER form with header and footer lines. 1725is a base64-encoded version of the DER form with header and footer lines.
1732.It Fl issuer 1726.It Fl issuer
1733Output the issuer name. 1727Output the issuer name.
1734.It Fl lastupdate 1728.It Fl lastupdate
@@ -1758,16 +1752,11 @@ The PEM CRL format uses the header and footer lines:
1758-----END X509 CRL----- 1752-----END X509 CRL-----
1759.Ed 1753.Ed
1760.Sh CRL EXAMPLES 1754.Sh CRL EXAMPLES
1761Convert a CRL file from 1755Convert a CRL file from PEM to DER:
1762.Ar PEM
1763to
1764.Ar DER :
1765.Pp 1756.Pp
1766.Dl $ openssl crl -in crl.pem -outform DER -out crl.der 1757.Dl $ openssl crl -in crl.pem -outform DER -out crl.der
1767.Pp 1758.Pp
1768Output the text form of a 1759Output the text form of a DER-encoded certificate:
1769.Ar DER
1770encoded certificate:
1771.Pp 1760.Pp
1772.Dl $ openssl crl -in crl.der -inform DER -text -noout 1761.Dl $ openssl crl -in crl.der -inform DER -text -noout
1773.Sh CRL BUGS 1762.Sh CRL BUGS
@@ -1799,23 +1788,21 @@ The options are as follows:
1799.It Fl certfile Ar file 1788.It Fl certfile Ar file
1800Specifies a 1789Specifies a
1801.Ar file 1790.Ar file
1802containing one or more certificates in 1791containing one or more certificates in PEM format.
1803.Ar PEM
1804format.
1805All certificates in the file will be added to the PKCS#7 structure. 1792All certificates in the file will be added to the PKCS#7 structure.
1806This option can be used more than once to read certificates from multiple 1793This option can be used more than once to read certificates from multiple
1807files. 1794files.
1808.It Fl in Ar file 1795.It Fl in Ar file
1809This specifies the input 1796This specifies the input
1810.Ar file 1797.Ar file
1811to read a CRL from or standard input if this option is not specified. 1798to read a CRL from, or standard input if this option is not specified.
1812.It Fl inform Ar DER | PEM 1799.It Fl inform Ar DER | PEM
1813This specifies the CRL input format. 1800This specifies the CRL input format.
1814.Ar DER 1801.Ar DER
1815format is a DER encoded CRL structure. 1802format is a DER-encoded CRL structure.
1816.Ar PEM 1803.Ar PEM
1817.Pq the default 1804.Pq the default
1818is a base64 encoded version of the DER form with header and footer lines. 1805is a base64-encoded version of the DER form with header and footer lines.
1819.It Fl nocrl 1806.It Fl nocrl
1820Normally, a CRL is included in the output file. 1807Normally, a CRL is included in the output file.
1821With this option, no CRL is 1808With this option, no CRL is
@@ -1823,23 +1810,21 @@ included in the output file and a CRL is not read from the input file.
1823.It Fl out Ar file 1810.It Fl out Ar file
1824Specifies the output 1811Specifies the output
1825.Ar file 1812.Ar file
1826to write the PKCS#7 structure to or standard output by default. 1813to write the PKCS#7 structure to, or standard output by default.
1827.It Fl outform Ar DER | PEM 1814.It Fl outform Ar DER | PEM
1828This specifies the PKCS#7 structure output format. 1815This specifies the PKCS#7 structure output format.
1829.Ar DER 1816.Ar DER
1830format is a DER encoded PKCS#7 structure. 1817format is a DER-encoded PKCS#7 structure.
1831.Ar PEM 1818.Ar PEM
1832.Pq the default 1819.Pq the default
1833is a base64 encoded version of the DER form with header and footer lines. 1820is a base64-encoded version of the DER form with header and footer lines.
1834.El 1821.El
1835.Sh CRL2PKCS7 EXAMPLES 1822.Sh CRL2PKCS7 EXAMPLES
1836Create a PKCS#7 structure from a certificate and CRL: 1823Create a PKCS#7 structure from a certificate and CRL:
1837.Pp 1824.Pp
1838.Dl $ openssl crl2pkcs7 -in crl.pem -certfile cert.pem -out p7.pem 1825.Dl $ openssl crl2pkcs7 -in crl.pem -certfile cert.pem -out p7.pem
1839.Pp 1826.Pp
1840Create a PKCS#7 structure in 1827Create a PKCS#7 structure in DER format with no CRL from several
1841.Ar DER
1842format with no CRL from several
1843different certificates: 1828different certificates:
1844.Bd -literal -offset indent 1829.Bd -literal -offset indent
1845$ openssl crl2pkcs7 -nocrl -certfile newcert.pem \e 1830$ openssl crl2pkcs7 -nocrl -certfile newcert.pem \e
@@ -1851,13 +1836,11 @@ just certificates and an optional CRL.
1851.Pp 1836.Pp
1852This utility can be used to send certificates and CAs to Netscape as part of 1837This utility can be used to send certificates and CAs to Netscape as part of
1853the certificate enrollment process. 1838the certificate enrollment process.
1854This involves sending the DER encoded output 1839This involves sending the DER-encoded output
1855as MIME type 1840as MIME type
1856.Em application/x-x509-user-cert . 1841.Em application/x-x509-user-cert .
1857.Pp 1842.Pp
1858The 1843The PEM-encoded form with the header and footer lines removed can be used to
1859.Ar PEM
1860encoded form with the header and footer lines removed can be used to
1861install user certificates and CAs in MSIE using the Xenroll control. 1844install user certificates and CAs in MSIE using the Xenroll control.
1862.\" 1845.\"
1863.\" DGST 1846.\" DGST
@@ -2046,17 +2029,17 @@ The engine will then be set as the default for all available algorithms.
2046.It Fl in Ar file 2029.It Fl in Ar file
2047This specifies the input 2030This specifies the input
2048.Ar file 2031.Ar file
2049to read parameters from or standard input if this option is not specified. 2032to read parameters from, or standard input if this option is not specified.
2050.It Fl inform Ar DER | PEM 2033.It Fl inform Ar DER | PEM
2051This specifies the input format. 2034This specifies the input format.
2052The argument 2035The argument
2053.Ar DER 2036.Ar DER
2054uses an ASN1 DER encoded form compatible with the PKCS#3 DHparameter 2037uses an ASN1 DER-encoded form compatible with the PKCS#3 DHparameter
2055structure. 2038structure.
2056The 2039The
2057.Ar PEM 2040.Ar PEM
2058form is the default format: 2041form is the default format:
2059it consists of the DER format base64 encoded with 2042it consists of the DER format base64-encoded with
2060additional header and footer lines. 2043additional header and footer lines.
2061.It Fl noout 2044.It Fl noout
2062This option inhibits the output of the encoded version of the parameters. 2045This option inhibits the output of the encoded version of the parameters.
@@ -2107,8 +2090,7 @@ programs are retained for now, but may have different purposes in future
2107versions of 2090versions of
2108.Nm OpenSSL . 2091.Nm OpenSSL .
2109.Sh DHPARAM NOTES 2092.Sh DHPARAM NOTES
2110.Ar PEM 2093PEM format DH parameters use the header and footer lines:
2111format DH parameters use the header and footer lines:
2112.Bd -unfilled -offset indent 2094.Bd -unfilled -offset indent
2113-----BEGIN DH PARAMETERS----- 2095-----BEGIN DH PARAMETERS-----
2114-----END DH PARAMETERS----- 2096-----END DH PARAMETERS-----
@@ -2185,9 +2167,7 @@ utility to read in an encrypted key with no encryption option can be used to
2185remove the pass phrase from a key, 2167remove the pass phrase from a key,
2186or by setting the encryption options it can be use to add or change 2168or by setting the encryption options it can be use to add or change
2187the pass phrase. 2169the pass phrase.
2188These options can only be used with 2170These options can only be used with PEM format output files.
2189.Ar PEM
2190format output files.
2191.It Fl engine Ar id 2171.It Fl engine Ar id
2192Specifying an engine (by it's unique 2172Specifying an engine (by it's unique
2193.Ar id 2173.Ar id
@@ -2199,13 +2179,13 @@ The engine will then be set as the default for all available algorithms.
2199.It Fl in Ar file 2179.It Fl in Ar file
2200This specifies the input 2180This specifies the input
2201.Ar file 2181.Ar file
2202to read a key from or standard input if this option is not specified. 2182to read a key from, or standard input if this option is not specified.
2203If the key is encrypted, a pass phrase will be prompted for. 2183If the key is encrypted, a pass phrase will be prompted for.
2204.It Fl inform Ar DER | PEM 2184.It Fl inform Ar DER | PEM
2205This specifies the input format. 2185This specifies the input format.
2206The 2186The
2207.Ar DER 2187.Ar DER
2208argument with a private key uses an ASN1 DER encoded form of an ASN.1 2188argument with a private key uses an ASN1 DER-encoded form of an ASN.1
2209SEQUENCE consisting of the values of version 2189SEQUENCE consisting of the values of version
2210.Pq currently zero , 2190.Pq currently zero ,
2211P, Q, G, 2191P, Q, G,
@@ -2217,8 +2197,8 @@ structure: it is an error if the key is not DSA.
2217The 2197The
2218.Ar PEM 2198.Ar PEM
2219form is the default format: 2199form is the default format:
2220it consists of the DER format base64 2200it consists of the DER format base64-encoded with additional header and footer
2221encoded with additional header and footer lines. 2201lines.
2222In the case of a private key, PKCS#8 format is also accepted. 2202In the case of a private key, PKCS#8 format is also accepted.
2223.It Fl modulus 2203.It Fl modulus
2224This option prints out the value of the public key component of the key. 2204This option prints out the value of the public key component of the key.
@@ -2262,17 +2242,13 @@ This option is automatically set if the input is a public key.
2262Prints out the public/private key components and parameters. 2242Prints out the public/private key components and parameters.
2263.El 2243.El
2264.Sh DSA NOTES 2244.Sh DSA NOTES
2265The 2245The PEM private key format uses the header and footer lines:
2266.Ar PEM
2267private key format uses the header and footer lines:
2268.Bd -unfilled -offset indent 2246.Bd -unfilled -offset indent
2269-----BEGIN DSA PRIVATE KEY----- 2247-----BEGIN DSA PRIVATE KEY-----
2270-----END DSA PRIVATE KEY----- 2248-----END DSA PRIVATE KEY-----
2271.Ed 2249.Ed
2272.Pp 2250.Pp
2273The 2251The PEM public key format uses the header and footer lines:
2274.Ar PEM
2275public key format uses the header and footer lines:
2276.Bd -unfilled -offset indent 2252.Bd -unfilled -offset indent
2277-----BEGIN PUBLIC KEY----- 2253-----BEGIN PUBLIC KEY-----
2278-----END PUBLIC KEY----- 2254-----END PUBLIC KEY-----
@@ -2349,13 +2325,13 @@ parameter is included, then this option will be ignored.
2349This specifies the input format. 2325This specifies the input format.
2350The 2326The
2351.Ar DER 2327.Ar DER
2352argument uses an ASN1 DER encoded form compatible with RFC 2459 2328argument uses an ASN1 DER-encoded form compatible with RFC 2459
2353.Pq PKIX 2329.Pq PKIX
2354DSS-Parms that is a SEQUENCE consisting of p, q and g, respectively. 2330DSS-Parms that is a SEQUENCE consisting of p, q and g, respectively.
2355The 2331The
2356.Ar PEM 2332.Ar PEM
2357form is the default format: 2333form is the default format:
2358it consists of the DER format base64 encoded with additional header 2334it consists of the DER format base64-encoded with additional header
2359and footer lines. 2335and footer lines.
2360.It Fl noout 2336.It Fl noout
2361This option inhibits the output of the encoded version of the parameters. 2337This option inhibits the output of the encoded version of the parameters.
@@ -2388,8 +2364,7 @@ Multiple files can be specified, separated by a
2388This option prints out the DSA parameters in human readable form. 2364This option prints out the DSA parameters in human readable form.
2389.El 2365.El
2390.Sh DSAPARAM NOTES 2366.Sh DSAPARAM NOTES
2391.Ar PEM 2367PEM format DSA parameters use the header and footer lines:
2392format DSA parameters use the header and footer lines:
2393.Bd -unfilled -offset indent 2368.Bd -unfilled -offset indent
2394-----BEGIN DSA PARAMETERS----- 2369-----BEGIN DSA PARAMETERS-----
2395-----END DSA PARAMETERS----- 2370-----END DSA PARAMETERS-----
@@ -2435,7 +2410,7 @@ If the
2435option is set, then base64 process the data on one line. 2410option is set, then base64 process the data on one line.
2436.It Fl a 2411.It Fl a
2437Base64 process the data. 2412Base64 process the data.
2438This means that if encryption is taking place, the data is base64 encoded 2413This means that if encryption is taking place, the data is base64-encoded
2439after encryption. 2414after encryption.
2440If decryption is set, then the input data is base64 decoded before 2415If decryption is set, then the input data is base64 decoded before
2441being decrypted. 2416being decrypted.
@@ -2950,10 +2925,10 @@ The options are as follows:
2950.It Fl in Ar file 2925.It Fl in Ar file
2951This specifies the input 2926This specifies the input
2952.Ar file 2927.Ar file
2953to read or standard input if this option is not specified. 2928to read, or standard input if this option is not specified.
2954.It Fl out Ar file 2929.It Fl out Ar file
2955Specifies the output 2930Specifies the output
2956.Ar file 2931.Ar file ,
2957or standard output by default. 2932or standard output by default.
2958.It Fl toseq 2933.It Fl toseq
2959Normally, a Netscape certificate sequence will be input and the output 2934Normally, a Netscape certificate sequence will be input and the output
@@ -2974,9 +2949,7 @@ Create a Netscape certificate sequence:
2974.Dl $ openssl nseq -in certs.pem -toseq -out nseq.pem 2949.Dl $ openssl nseq -in certs.pem -toseq -out nseq.pem
2975.Ed 2950.Ed
2976.Sh NSEQ NOTES 2951.Sh NSEQ NOTES
2977The 2952The PEM-encoded form uses the same headers and footers as a certificate:
2978.Em PEM
2979encoded form uses the same headers and footers as a certificate:
2980.Bd -unfilled -offset indent 2953.Bd -unfilled -offset indent
2981-----BEGIN CERTIFICATE----- 2954-----BEGIN CERTIFICATE-----
2982-----END CERTIFICATE----- 2955-----END CERTIFICATE-----
@@ -2988,12 +2961,9 @@ certificates are sent to the browser:
2988for example during certificate enrollment. 2961for example during certificate enrollment.
2989It is used by the Netscape certificate server, for example. 2962It is used by the Netscape certificate server, for example.
2990.Sh NSEQ BUGS 2963.Sh NSEQ BUGS
2991This program needs a few more options: 2964This program needs a few more options,
2992like allowing 2965like allowing DER or PEM input and output files
2993.Em DER 2966and allowing multiple certificate files to be used.
2994or
2995.Em PEM
2996input and output files and allowing multiple certificate files to be used.
2997.\" 2967.\"
2998.\" OCSP 2968.\" OCSP
2999.\" 2969.\"
@@ -3097,9 +3067,7 @@ This specifies the current issuer certificate.
3097This option can be used multiple times. 3067This option can be used multiple times.
3098The certificate specified in 3068The certificate specified in
3099.Ar file 3069.Ar file
3100must be in 3070must be in PEM format.
3101.Ar PEM
3102format.
3103.It Fl no_cert_checks 3071.It Fl no_cert_checks
3104Don't perform any additional checks on the OCSP response signer's certificate. 3072Don't perform any additional checks on the OCSP response signer's certificate.
3105That is, do not make any checks to see if the signer's certificate is 3073That is, do not make any checks to see if the signer's certificate is
@@ -3174,9 +3142,7 @@ and
3174.Fl host 3142.Fl host
3175options). 3143options).
3176.It Fl reqout Ar file , Fl respout Ar file 3144.It Fl reqout Ar file , Fl respout Ar file
3177Write out the 3145Write out the DER-encoded certificate request or response to
3178.Ar DER
3179encoded certificate request or response to
3180.Ar file . 3146.Ar file .
3181.It Fl serial Ar num 3147.It Fl serial Ar num
3182Same as the 3148Same as the
@@ -3557,70 +3523,63 @@ prints
3557.Sh PKCS7 3523.Sh PKCS7
3558.Nm openssl pkcs7 3524.Nm openssl pkcs7
3559.Bk -words 3525.Bk -words
3560.Op Fl inform Ar DER | PEM 3526.Op Fl noout
3561.Op Fl outform Ar DER | PEM
3562.Op Fl in Ar file
3563.Op Fl out Ar file
3564.Op Fl print_certs 3527.Op Fl print_certs
3565.Op Fl text 3528.Op Fl text
3566.Op Fl noout
3567.Op Fl engine Ar id 3529.Op Fl engine Ar id
3530.Op Fl in Ar file
3531.Op Fl inform Ar DER | PEM
3532.Op Fl out Ar file
3533.Op Fl outform Ar DER | PEM
3568.Ek 3534.Ek
3569.Pp 3535.Pp
3570The 3536The
3571.Nm pkcs7 3537.Nm pkcs7
3572command processes PKCS#7 files in 3538command processes PKCS#7 files in DER or PEM format.
3573.Em DER
3574or
3575.Em PEM
3576format.
3577.Pp 3539.Pp
3578The options are as follows: 3540The options are as follows:
3579.Bl -tag -width "XXXX" 3541.Bl -tag -width "XXXX"
3542.It Fl engine Ar id
3543Specifying an engine (by it's unique
3544.Ar id
3545string) will cause
3546.Nm pkcs7
3547to attempt to obtain a functional reference to the specified engine,
3548thus initialising it if needed.
3549The engine will then be set as the default for all available algorithms.
3550.It Fl in Ar file
3551This specifies the input
3552.Ar file
3553to read from, or standard input if this option is not specified.
3580.It Fl inform Ar DER | PEM 3554.It Fl inform Ar DER | PEM
3581This specifies the input format. 3555This specifies the input format.
3582.Ar DER 3556.Ar DER
3583format is a DER encoded PKCS#7 v1.5 structure. 3557format is a DER-encoded PKCS#7 v1.5 structure.
3584.Ar PEM 3558.Ar PEM
3585.Pq the default 3559.Pq the default
3586is a base64 encoded version of the DER form with header and footer lines. 3560is a base64-encoded version of the DER form with header and footer lines.
3561.It Fl noout
3562Don't output the encoded version of the PKCS#7 structure
3563(or certificates if
3564.Fl print_certs
3565is set).
3566.It Fl out Ar file
3567Specifies the output
3568.Ar file
3569to write to, or standard output by default.
3587.It Fl outform Ar DER | PEM 3570.It Fl outform Ar DER | PEM
3588This specifies the output format; the options have the same meaning as the 3571This specifies the output format; the options have the same meaning as the
3589.Fl inform 3572.Fl inform
3590option. 3573option.
3591.It Fl in Ar file
3592This specifies the input
3593.Ar file
3594to read from or standard input if this option is not specified.
3595.It Fl out Ar file
3596Specifies the output
3597.Ar file
3598to write to or standard output by default.
3599.It Fl print_certs 3574.It Fl print_certs
3600Prints out any certificates or CRLs contained in the file. 3575Prints out any certificates or CRLs contained in the file.
3601They are preceded by their subject and issuer names in one line format. 3576They are preceded by their subject and issuer names in a one-line format.
3602.It Fl text 3577.It Fl text
3603Prints out certificate details in full rather than just subject and 3578Prints out certificate details in full rather than just subject and
3604issuer names. 3579issuer names.
3605.It Fl noout
3606Don't output the encoded version of the PKCS#7 structure
3607(or certificates if
3608.Fl print_certs
3609is set).
3610.It Fl engine Ar id
3611Specifying an engine (by it's unique
3612.Ar id
3613string) will cause
3614.Nm pkcs7
3615to attempt to obtain a functional reference to the specified engine,
3616thus initialising it if needed.
3617The engine will then be set as the default for all available algorithms.
3618.El 3580.El
3619.Sh PKCS7 EXAMPLES 3581.Sh PKCS7 EXAMPLES
3620Convert a PKCS#7 file from 3582Convert a PKCS#7 file from PEM to DER:
3621.Em PEM
3622to
3623.Em DER :
3624.Pp 3583.Pp
3625.Dl $ openssl pkcs7 -in file.pem -outform DER -out file.der 3584.Dl $ openssl pkcs7 -in file.pem -outform DER -out file.der
3626.Pp 3585.Pp
@@ -3628,9 +3587,7 @@ Output all certificates in a file:
3628.Pp 3587.Pp
3629.Dl $ openssl pkcs7 -in file.pem -print_certs -out certs.pem 3588.Dl $ openssl pkcs7 -in file.pem -print_certs -out certs.pem
3630.Sh PKCS7 NOTES 3589.Sh PKCS7 NOTES
3631The 3590The PEM PKCS#7 format uses the header and footer lines:
3632.Em PEM
3633PKCS#7 format uses the header and footer lines:
3634.Bd -unfilled -offset indent 3591.Bd -unfilled -offset indent
3635-----BEGIN PKCS7----- 3592-----BEGIN PKCS7-----
3636-----END PKCS7----- 3593-----END PKCS7-----
@@ -3652,21 +3609,21 @@ They cannot currently parse, for example, the new CMS as described in RFC 2630.
3652.Sh PKCS8 3609.Sh PKCS8
3653.Nm openssl pkcs8 3610.Nm openssl pkcs8
3654.Bk -words 3611.Bk -words
3612.Op Fl embed
3613.Op Fl nocrypt
3614.Op Fl noiter
3615.Op Fl nooct
3616.Op Fl nsdb
3655.Op Fl topk8 3617.Op Fl topk8
3618.Op Fl engine Ar id
3619.Op Fl in Ar file
3656.Op Fl inform Ar DER | PEM 3620.Op Fl inform Ar DER | PEM
3621.Op Fl out Ar file
3657.Op Fl outform Ar DER | PEM 3622.Op Fl outform Ar DER | PEM
3658.Op Fl in Ar file
3659.Op Fl passin Ar arg 3623.Op Fl passin Ar arg
3660.Op Fl out Ar file
3661.Op Fl passout Ar arg 3624.Op Fl passout Ar arg
3662.Op Fl noiter
3663.Op Fl nocrypt
3664.Op Fl nooct
3665.Op Fl embed
3666.Op Fl nsdb
3667.Op Fl v2 Ar alg
3668.Op Fl v1 Ar alg 3625.Op Fl v1 Ar alg
3669.Op Fl engine Ar id 3626.Op Fl v2 Ar alg
3670.Ek 3627.Ek
3671.Pp 3628.Pp
3672The 3629The
@@ -3679,67 +3636,44 @@ and PKCS#12 algorithms.
3679.Pp 3636.Pp
3680The options are as follows: 3637The options are as follows:
3681.Bl -tag -width "XXXX" 3638.Bl -tag -width "XXXX"
3682.It Fl topk8 3639.It Fl embed
3683Normally, a PKCS#8 private key is expected on input and a traditional format 3640This option generates DSA keys in a broken format.
3684private key will be written. 3641The DSA parameters are embedded inside the
3685With the 3642.Em PrivateKey
3686.Fl topk8 3643structure.
3687option the situation is reversed: 3644In this form the OCTET STRING contains an ASN1 SEQUENCE consisting of
3688it reads a traditional format private key and writes a PKCS#8 format key. 3645two structures:
3689.It Fl inform Ar DER | PEM 3646a SEQUENCE containing the parameters and an ASN1 INTEGER containing
3690This specifies the input format. 3647the private key.
3691If a PKCS#8 format key is expected on input, 3648.It Fl engine Ar id
3692then either a 3649Specifying an engine (by it's unique
3693.Em DER 3650.Ar id
3694or 3651string) will cause
3695.Em PEM 3652.Nm pkcs8
3696encoded version of a PKCS#8 key will be expected. 3653to attempt to obtain a functional reference to the specified engine,
3697Otherwise the 3654thus initialising it if needed.
3698.Em DER 3655The engine will then be set as the default for all available algorithms.
3699or
3700.Em PEM
3701format of the traditional format private key is used.
3702.It Fl outform Ar DER | PEM
3703This specifies the output format; the options have the same meaning as the
3704.Fl inform
3705option.
3706.It Fl in Ar file 3656.It Fl in Ar file
3707This specifies the input 3657This specifies the input
3708.Ar file 3658.Ar file
3709to read a key from or standard input if this option is not specified. 3659to read a key from, or standard input if this option is not specified.
3710If the key is encrypted, a pass phrase will be prompted for. 3660If the key is encrypted, a pass phrase will be prompted for.
3711.It Fl passin Ar arg 3661.It Fl inform Ar DER | PEM
3712The input file password source. 3662This specifies the input format.
3713For more information about the format of 3663If a PKCS#8 format key is expected on input,
3714.Ar arg , 3664then either a
3715see the 3665DER- or PEM-encoded version of a PKCS#8 key will be expected.
3716.Sx PASS PHRASE ARGUMENTS 3666Otherwise the DER or PEM format of the traditional format private key is used.
3717section above.
3718.It Fl out Ar file
3719This specifies the output
3720.Ar file
3721to write a key to or standard output by default.
3722If any encryption options are set then a pass phrase will be prompted for.
3723The output filename should
3724.Em not
3725be the same as the input filename.
3726.It Fl passout Ar arg
3727The output file password source.
3728For more information about the format of
3729.Ar arg ,
3730see the
3731.Sx PASS PHRASE ARGUMENTS
3732section above.
3733.It Fl nocrypt 3667.It Fl nocrypt
3734PKCS#8 keys generated or input are normally PKCS#8 3668PKCS#8 keys generated or input are normally PKCS#8
3735.Em EncryptedPrivateKeyInfo 3669.Em EncryptedPrivateKeyInfo
3736structures using an appropriate password based encryption algorithm. 3670structures using an appropriate password-based encryption algorithm.
3737With this option an unencrypted 3671With this option, an unencrypted
3738.Em PrivateKeyInfo 3672.Em PrivateKeyInfo
3739structure is expected or output. 3673structure is expected or output.
3740This option does not encrypt private keys at all and should only be used 3674This option does not encrypt private keys at all and should only be used
3741when absolutely necessary. 3675when absolutely necessary.
3742Certain software such as some versions of Java code signing software used 3676Certain software such as some versions of Java code signing software use
3743unencrypted private keys. 3677unencrypted private keys.
3744.It Fl nooct 3678.It Fl nooct
3745This option generates RSA private keys in a broken format that some software 3679This option generates RSA private keys in a broken format that some software
@@ -3747,24 +3681,51 @@ uses.
3747Specifically the private key should be enclosed in an OCTET STRING, 3681Specifically the private key should be enclosed in an OCTET STRING,
3748but some software just includes the structure itself without the 3682but some software just includes the structure itself without the
3749surrounding OCTET STRING. 3683surrounding OCTET STRING.
3750.It Fl embed
3751This option generates DSA keys in a broken format.
3752The DSA parameters are embedded inside the
3753.Em PrivateKey
3754structure.
3755In this form the OCTET STRING contains an ASN1 SEQUENCE consisting of
3756two structures:
3757a SEQUENCE containing the parameters and an ASN1 INTEGER containing
3758the private key.
3759.It Fl nsdb 3684.It Fl nsdb
3760This option generates DSA keys in a broken format compatible with Netscape 3685This option generates DSA keys in a broken format compatible with Netscape
3761private key databases. 3686private key databases.
3762The 3687The
3763.Em PrivateKey 3688.Em PrivateKey
3764contains a SEQUENCE consisting of the public and private keys, respectively. 3689contains a SEQUENCE consisting of the public and private keys, respectively.
3690.It Fl out Ar file
3691This specifies the output
3692.Ar file
3693to write a key to, or standard output by default.
3694If any encryption options are set, then a pass phrase will be prompted for.
3695The output filename should
3696.Em not
3697be the same as the input filename.
3698.It Fl outform Ar DER | PEM
3699This specifies the output format; the options have the same meaning as the
3700.Fl inform
3701option.
3702.It Fl passin Ar arg
3703The input file password source.
3704For more information about the format of
3705.Ar arg ,
3706see the
3707.Sx PASS PHRASE ARGUMENTS
3708section above.
3709.It Fl passout Ar arg
3710The output file password source.
3711For more information about the format of
3712.Ar arg ,
3713see the
3714.Sx PASS PHRASE ARGUMENTS
3715section above.
3716.It Fl topk8
3717Normally, a PKCS#8 private key is expected on input and a traditional format
3718private key will be written.
3719With the
3720.Fl topk8
3721option the situation is reversed:
3722it reads a traditional format private key and writes a PKCS#8 format key.
3723.It Fl v1 Ar alg
3724This option specifies a PKCS#5 v1.5 or PKCS#12 algorithm to use.
3725A complete list of possible algorithms is included below.
3765.It Fl v2 Ar alg 3726.It Fl v2 Ar alg
3766This option enables the use of PKCS#5 v2.0 algorithms. 3727This option enables the use of PKCS#5 v2.0 algorithms.
3767Normally, PKCS#8 private keys are encrypted with the password based 3728Normally, PKCS#8 private keys are encrypted with the password-based
3768encryption algorithm called 3729encryption algorithm called
3769.Em pbeWithMD5AndDES-CBC ; 3730.Em pbeWithMD5AndDES-CBC ;
3770this uses 56-bit DES encryption but it was the strongest encryption 3731this uses 56-bit DES encryption but it was the strongest encryption
@@ -3780,29 +3741,16 @@ then this doesn't matter.
3780.Pp 3741.Pp
3781The 3742The
3782.Ar alg 3743.Ar alg
3783argument is the encryption algorithm to use, valid values include 3744argument is the encryption algorithm to use; valid values include
3784.Ar des , des3 3745.Ar des , des3 ,
3785and 3746and
3786.Ar rc2 . 3747.Ar rc2 .
3787It is recommended that 3748It is recommended that
3788.Ar des3 3749.Ar des3
3789is used. 3750is used.
3790.It Fl v1 Ar alg
3791This option specifies a PKCS#5 v1.5 or PKCS#12 algorithm to use.
3792A complete list of possible algorithms is included below.
3793.It Fl engine Ar id
3794Specifying an engine (by it's unique
3795.Ar id
3796string) will cause
3797.Nm pkcs8
3798to attempt to obtain a functional reference to the specified engine,
3799thus initialising it if needed.
3800The engine will then be set as the default for all available algorithms.
3801.El 3751.El
3802.Sh PKCS8 NOTES 3752.Sh PKCS8 NOTES
3803The encrypted form of a 3753The encrypted form of a PEM-encoded PKCS#8 file uses the following
3804.Em PEM
3805encoded PKCS#8 file uses the following
3806headers and footers: 3754headers and footers:
3807.Bd -unfilled -offset indent 3755.Bd -unfilled -offset indent
3808-----BEGIN ENCRYPTED PRIVATE KEY----- 3756-----BEGIN ENCRYPTED PRIVATE KEY-----
@@ -3816,25 +3764,22 @@ The unencrypted form uses:
3816.Ed 3764.Ed
3817.Pp 3765.Pp
3818Private keys encrypted using PKCS#5 v2.0 algorithms and high iteration 3766Private keys encrypted using PKCS#5 v2.0 algorithms and high iteration
3819counts are more secure that those encrypted using the traditional 3767counts are more secure than those encrypted using the traditional
3820.Nm SSLeay 3768.Nm SSLeay
3821compatible formats. 3769compatible formats.
3822So if additional security is considered, important the keys should be converted. 3770So if additional security is considered important, the keys should be converted.
3823.Pp 3771.Pp
3824The default encryption is only 56 bits because this is the encryption 3772The default encryption is only 56 bits because this is the encryption
3825that most current implementations of PKCS#8 will support. 3773that most current implementations of PKCS#8 support.
3826.Pp 3774.Pp
3827Some software may use PKCS#12 password based encryption algorithms 3775Some software may use PKCS#12 password-based encryption algorithms
3828with PKCS#8 format private keys: these are handled automatically 3776with PKCS#8 format private keys: these are handled automatically
3829but there is no option to produce them. 3777but there is no option to produce them.
3830.Pp 3778.Pp
3831It is possible to write out 3779It is possible to write out
3832.Em DER 3780DER-encoded encrypted private keys in PKCS#8 format because the encryption
3833encoded encrypted private keys in PKCS#8 format because the encryption
3834details are included at an ASN1 3781details are included at an ASN1
3835level whereas the traditional format includes them at a 3782level whereas the traditional format includes them at a PEM level.
3836.Em PEM
3837level.
3838.Sh PKCS#5 V1.5 AND PKCS#12 ALGORITHMS 3783.Sh PKCS#5 V1.5 AND PKCS#12 ALGORITHMS
3839Various algorithms can be used with the 3784Various algorithms can be used with the
3840.Fl v1 3785.Fl v1
@@ -3855,7 +3800,7 @@ They use either 64-bit RC2 or 56-bit DES.
3855.Pp 3800.Pp
3856.It Ar PBE-SHA1-RC4-128 | PBE-SHA1-RC4-40 | PBE-SHA1-3DES | PBE-SHA1-2DES 3801.It Ar PBE-SHA1-RC4-128 | PBE-SHA1-RC4-40 | PBE-SHA1-3DES | PBE-SHA1-2DES
3857.It Ar PBE-SHA1-RC2-128 | PBE-SHA1-RC2-40 3802.It Ar PBE-SHA1-RC2-128 | PBE-SHA1-RC2-40
3858These algorithms use the PKCS#12 password based encryption algorithm and 3803These algorithms use the PKCS#12 password-based encryption algorithm and
3859allow strong encryption algorithms like triple DES or 128-bit RC2 to be used. 3804allow strong encryption algorithms like triple DES or 128-bit RC2 to be used.
3860.El 3805.El
3861.Sh PKCS8 EXAMPLES 3806.Sh PKCS8 EXAMPLES
@@ -3875,7 +3820,7 @@ $ openssl pkcs8 -in key.pem -topk8 -out enckey.pem \e
3875 -v1 PBE-SHA1-3DES 3820 -v1 PBE-SHA1-3DES
3876.Ed 3821.Ed
3877.Pp 3822.Pp
3878Read a DER unencrypted PKCS#8 format private key: 3823Read a DER-unencrypted PKCS#8 format private key:
3879.Pp 3824.Pp
3880.Dl "$ openssl pkcs8 -inform DER -nocrypt -in key.der -out key.pem" 3825.Dl "$ openssl pkcs8 -inform DER -nocrypt -in key.der -out key.pem"
3881.Pp 3826.Pp
@@ -3893,7 +3838,7 @@ algorithms are concerned.
3893The format of PKCS#8 DSA 3838The format of PKCS#8 DSA
3894.Pq and other 3839.Pq and other
3895private keys is not well documented: 3840private keys is not well documented:
3896it is hidden away in PKCS#11 v2.01, section 11.9.; 3841it is hidden away in PKCS#11 v2.01, section 11.9;
3897.Nm OpenSSL Ns Li 's 3842.Nm OpenSSL Ns Li 's
3898default DSA PKCS#8 private key format complies with this standard. 3843default DSA PKCS#8 private key format complies with this standard.
3899.Sh PKCS8 BUGS 3844.Sh PKCS8 BUGS
@@ -3910,41 +3855,41 @@ compatibility, several of the utilities use the old format at present.
3910.Sh PKCS12 3855.Sh PKCS12
3911.Nm "openssl pkcs12" 3856.Nm "openssl pkcs12"
3912.Bk -words 3857.Bk -words
3913.Op Fl export 3858.Oo
3859.Fl aes128 | aes192 | aes256 |
3860.Fl des | des3
3861.Oc
3862.Op Fl cacerts
3863.Op Fl certpbe
3914.Op Fl chain 3864.Op Fl chain
3915.Op Fl inkey Ar file
3916.Op Fl certfile Ar file
3917.Op Fl CApath Ar directory
3918.Op Fl CAfile Ar file
3919.Op Fl name Ar name
3920.Op Fl caname Ar name
3921.Op Fl in Ar file
3922.Op Fl out Ar file
3923.Op Fl noout
3924.Op Fl nomacver
3925.Op Fl nocerts
3926.Op Fl clcerts 3865.Op Fl clcerts
3927.Op Fl cacerts 3866.Op Fl descert
3928.Op Fl nokeys 3867.Op Fl export
3929.Op Fl info 3868.Op Fl info
3930.Oo 3869.Op Fl keyex
3931.Fl des | des3 | aes128 | 3870.Op Fl keypbe
3932.Fl aes192 | aes256 3871.Op Fl keysig
3933.Oc 3872.Op Fl maciter
3873.Op Fl nocerts
3934.Op Fl nodes 3874.Op Fl nodes
3935.Op Fl noiter 3875.Op Fl noiter
3936.Op Fl maciter 3876.Op Fl nokeys
3877.Op Fl nomacver
3878.Op Fl noout
3937.Op Fl twopass 3879.Op Fl twopass
3938.Op Fl descert 3880.Op Fl CAfile Ar file
3939.Op Fl certpbe 3881.Op Fl CApath Ar directory
3940.Op Fl keypbe 3882.Op Fl caname Ar name
3941.Op Fl keyex 3883.Op Fl certfile Ar file
3942.Op Fl keysig 3884.Op Fl engine Ar id
3943.Op Fl password Ar arg 3885.Op Fl in Ar file
3886.Op Fl inkey Ar file
3887.Op Fl name Ar name
3888.Op Fl out Ar file
3944.Op Fl passin Ar arg 3889.Op Fl passin Ar arg
3945.Op Fl passout Ar arg 3890.Op Fl passout Ar arg
3891.Op Fl password Ar arg
3946.Op Fl rand Ar file ... 3892.Op Fl rand Ar file ...
3947.Op Fl engine Ar id
3948.Ek 3893.Ek
3949.Pp 3894.Pp
3950The 3895The
@@ -3964,18 +3909,43 @@ option
3964.Pq see below . 3909.Pq see below .
3965.Sh PKCS12 PARSING OPTIONS 3910.Sh PKCS12 PARSING OPTIONS
3966.Bl -tag -width "XXXX" 3911.Bl -tag -width "XXXX"
3912.It Xo
3913.Fl aes128 | aes192 | aes256 |
3914.Fl des | des3
3915.Xc
3916Use AES, DES, or triple DES, respectively,
3917to encrypt private keys before outputting.
3918The default is triple DES.
3919.It Fl cacerts
3920Only output CA certificates
3921.Pq not client certificates .
3922.It Fl clcerts
3923Only output client certificates
3924.Pq not CA certificates .
3967.It Fl in Ar file 3925.It Fl in Ar file
3968This specifies the 3926This specifies the
3969.Ar file 3927.Ar file
3970of the PKCS#12 file to be parsed. 3928of the PKCS#12 file to be parsed.
3971Standard input is used by default. 3929Standard input is used by default.
3930.It Fl info
3931Output additional information about the PKCS#12 file structure,
3932algorithms used, and iteration counts.
3933.It Fl nocerts
3934No certificates at all will be output.
3935.It Fl nodes
3936Don't encrypt the private keys at all.
3937.It Fl nokeys
3938No private keys will be output.
3939.It Fl nomacver
3940Don't attempt to verify the integrity MAC before reading the file.
3941.It Fl noout
3942This option inhibits output of the keys and certificates to the output file
3943version of the PKCS#12 file.
3972.It Fl out Ar file 3944.It Fl out Ar file
3973The 3945The
3974.Ar file 3946.Ar file
3975to write certificates and private keys to, standard output by default. 3947to write certificates and private keys to, standard output by default.
3976They are all written in 3948They are all written in PEM format.
3977.Em PEM
3978format.
3979.It Fl pass Ar arg , Fl passin Ar arg 3949.It Fl pass Ar arg , Fl passin Ar arg
3980The PKCS#12 file 3950The PKCS#12 file
3981.Pq i.e. input file 3951.Pq i.e. input file
@@ -3992,33 +3962,6 @@ For more information about the format of
3992see the 3962see the
3993.Sx PASS PHRASE ARGUMENTS 3963.Sx PASS PHRASE ARGUMENTS
3994section above. 3964section above.
3995.It Fl noout
3996This option inhibits output of the keys and certificates to the output file
3997version of the PKCS#12 file.
3998.It Fl clcerts
3999Only output client certificates
4000.Pq not CA certificates .
4001.It Fl cacerts
4002Only output CA certificates
4003.Pq not client certificates .
4004.It Fl nocerts
4005No certificates at all will be output.
4006.It Fl nokeys
4007No private keys will be output.
4008.It Fl info
4009Output additional information about the PKCS#12 file structure,
4010algorithms used and iteration counts.
4011.It Xo
4012.Fl des | des3 | aes128 |
4013.Fl aes192 | aes256
4014.Xc
4015Use DES, triple DES, or AES, respectively,
4016to encrypt private keys before outputting.
4017The default is triple DES.
4018.It Fl nodes
4019Don't encrypt the private keys at all.
4020.It Fl nomacver
4021Don't attempt to verify the integrity MAC before reading the file.
4022.It Fl twopass 3965.It Fl twopass
4023Prompt for separate integrity and encryption passwords: most software 3966Prompt for separate integrity and encryption passwords: most software
4024always assumes these are the same so this option will render such 3967always assumes these are the same so this option will render such
@@ -4026,41 +3969,12 @@ PKCS#12 files unreadable.
4026.El 3969.El
4027.Sh PKCS12 FILE CREATION OPTIONS 3970.Sh PKCS12 FILE CREATION OPTIONS
4028.Bl -tag -width "XXXX" 3971.Bl -tag -width "XXXX"
4029.It Fl export
4030This option specifies that a PKCS#12 file will be created rather than
4031parsed.
4032.It Fl out Ar file
4033This specifies
4034.Ar file
4035to write the PKCS#12 file to.
4036Standard output is used by default.
4037.It Fl in Ar file
4038The
4039.Ar file
4040to read certificates and private keys from, standard input by default.
4041They must all be in
4042.Em PEM
4043format.
4044The order doesn't matter but one private key and its corresponding
4045certificate should be present.
4046If additional certificates are present, they will also be included
4047in the PKCS#12 file.
4048.It Fl inkey Ar file
4049File to read private key from.
4050If not present then a private key must be present in the input file.
4051.It Fl name Ar friendlyname
4052This specifies the
4053.Qq friendly name
4054for the certificate and private key.
4055This name is typically displayed in list boxes by software importing the file.
4056.It Fl certfile Ar file
4057A file to read additional certificates from.
4058.It Fl CApath Ar directory
4059Directory of CAs
4060.Pq PEM format .
4061.It Fl CAfile Ar file 3972.It Fl CAfile Ar file
4062File of CAs 3973File of CAs
4063.Pq PEM format . 3974.Pq PEM format .
3975.It Fl CApath Ar directory
3976Directory of CAs
3977.Pq PEM format .
4064.It Fl caname Ar friendlyname 3978.It Fl caname Ar friendlyname
4065This specifies the 3979This specifies the
4066.Qq friendly name 3980.Qq friendly name
@@ -4069,22 +3983,8 @@ This option may be used multiple times to specify names for all certificates
4069in the order they appear. 3983in the order they appear.
4070Netscape ignores friendly names on other certificates, 3984Netscape ignores friendly names on other certificates,
4071whereas MSIE displays them. 3985whereas MSIE displays them.
4072.It Fl pass Ar arg , Fl passout Ar arg 3986.It Fl certfile Ar file
4073The PKCS#12 file 3987A file to read additional certificates from.
4074.Pq i.e. output file
4075password source.
4076For more information about the format of
4077.Ar arg ,
4078see the
4079.Sx PASS PHRASE ARGUMENTS
4080section above.
4081.It Fl passin Ar password
4082Pass phrase source to decrypt any input private keys with.
4083For more information about the format of
4084.Ar arg ,
4085see the
4086.Sx PASS PHRASE ARGUMENTS
4087section above.
4088.It Fl chain 3988.It Fl chain
4089If this option is present, then an attempt is made to include the entire 3989If this option is present, then an attempt is made to include the entire
4090certificate chain of the user certificate. 3990certificate chain of the user certificate.
@@ -4097,14 +3997,29 @@ file unreadable by some
4097software. 3997software.
4098By default, the private key is encrypted using triple DES and the 3998By default, the private key is encrypted using triple DES and the
4099certificate using 40-bit RC2. 3999certificate using 40-bit RC2.
4100.It Fl keypbe Ar alg , Fl certpbe Ar alg 4000.It Fl engine Ar id
4101These options allow the algorithm used to encrypt the private key and 4001Specifying an engine (by it's unique
4102certificates to be selected. 4002.Ar id
4103Although any PKCS#5 v1.5 or PKCS#12 algorithms can be selected, 4003string) will cause
4104it is advisable to only use PKCS#12 algorithms. 4004.Nm pkcs12
4105See the list in the 4005to attempt to obtain a functional reference to the specified engine,
4106.Sx PKCS12 NOTES 4006thus initialising it if needed.
4107section for more information. 4007The engine will then be set as the default for all available algorithms.
4008.It Fl export
4009This option specifies that a PKCS#12 file will be created rather than
4010parsed.
4011.It Fl in Ar file
4012The
4013.Ar file
4014to read certificates and private keys from, standard input by default.
4015They must all be in PEM format.
4016The order doesn't matter but one private key and its corresponding
4017certificate should be present.
4018If additional certificates are present, they will also be included
4019in the PKCS#12 file.
4020.It Fl inkey Ar file
4021File to read private key from.
4022If not present, then a private key must be present in the input file.
4108.It Fl keyex | keysig 4023.It Fl keyex | keysig
4109Specifies that the private key is to be used for key exchange or just signing. 4024Specifies that the private key is to be used for key exchange or just signing.
4110This option is only interpreted by MSIE and similar MS software. 4025This option is only interpreted by MSIE and similar MS software.
@@ -4120,6 +4035,22 @@ Signing only keys can be used for S/MIME signing, authenticode
4120and SSL client authentication; 4035and SSL client authentication;
4121however, due to a bug only MSIE 5.0 and later support 4036however, due to a bug only MSIE 5.0 and later support
4122the use of signing only keys for SSL client authentication. 4037the use of signing only keys for SSL client authentication.
4038.It Fl keypbe Ar alg , Fl certpbe Ar alg
4039These options allow the algorithm used to encrypt the private key and
4040certificates to be selected.
4041Although any PKCS#5 v1.5 or PKCS#12 algorithms can be selected,
4042it is advisable to only use PKCS#12 algorithms.
4043See the list in the
4044.Sx PKCS12 NOTES
4045section for more information.
4046.It Fl maciter
4047This option is included for compatibility with previous versions; it used
4048to be needed to use MAC iterations counts but they are now used by default.
4049.It Fl name Ar friendlyname
4050This specifies the
4051.Qq friendly name
4052for the certificate and private key.
4053This name is typically displayed in list boxes by software importing the file.
4123.It Fl nomaciter , noiter 4054.It Fl nomaciter , noiter
4124These options affect the iteration counts on the MAC and key algorithms. 4055These options affect the iteration counts on the MAC and key algorithms.
4125Unless you wish to produce files compatible with MSIE 4.0, you should leave 4056Unless you wish to produce files compatible with MSIE 4.0, you should leave
@@ -4139,9 +4070,27 @@ Most software supports both MAC and key iteration counts.
4139MSIE 4.0 doesn't support MAC iteration counts, so it needs the 4070MSIE 4.0 doesn't support MAC iteration counts, so it needs the
4140.Fl nomaciter 4071.Fl nomaciter
4141option. 4072option.
4142.It Fl maciter 4073.It Fl out Ar file
4143This option is included for compatibility with previous versions; it used 4074This specifies
4144to be needed to use MAC iterations counts but they are now used by default. 4075.Ar file
4076to write the PKCS#12 file to.
4077Standard output is used by default.
4078.It Fl pass Ar arg , Fl passout Ar arg
4079The PKCS#12 file
4080.Pq i.e. output file
4081password source.
4082For more information about the format of
4083.Ar arg ,
4084see the
4085.Sx PASS PHRASE ARGUMENTS
4086section above.
4087.It Fl passin Ar password
4088Pass phrase source to decrypt any input private keys with.
4089For more information about the format of
4090.Ar arg ,
4091see the
4092.Sx PASS PHRASE ARGUMENTS
4093section above.
4145.It Fl rand Ar file ... 4094.It Fl rand Ar file ...
4146A file or files 4095A file or files
4147containing random data used to seed the random number generator, 4096containing random data used to seed the random number generator,
@@ -4149,14 +4098,6 @@ or an EGD socket (see
4149.Xr RAND_egd 3 ) . 4098.Xr RAND_egd 3 ) .
4150Multiple files can be specified separated by a 4099Multiple files can be specified separated by a
4151.Sq \&: . 4100.Sq \&: .
4152.It Fl engine Ar id
4153Specifying an engine (by it's unique
4154.Ar id
4155string) will cause
4156.Nm pkcs12
4157to attempt to obtain a functional reference to the specified engine,
4158thus initialising it if needed.
4159The engine will then be set as the default for all available algorithms.
4160.El 4101.El
4161.Sh PKCS12 NOTES 4102.Sh PKCS12 NOTES
4162Although there are a large number of options, 4103Although there are a large number of options,
@@ -4395,12 +4336,11 @@ The options are as follows:
4395This specifies the input format. 4336This specifies the input format.
4396The 4337The
4397.Ar DER 4338.Ar DER
4398argument uses an ASN1 DER encoded 4339argument uses an ASN1 DER-encoded form compatible with the PKCS#10.
4399form compatible with the PKCS#10.
4400The 4340The
4401.Ar PEM 4341.Ar PEM
4402form is the default format: 4342form is the default format:
4403it consists of the DER format base64 encoded with additional header and 4343it consists of the DER format base64-encoded with additional header and
4404footer lines. 4344footer lines.
4405.It Fl outform Ar DER | PEM 4345.It Fl outform Ar DER | PEM
4406This specifies the output format; the options have the same meaning as the 4346This specifies the output format; the options have the same meaning as the
@@ -4475,9 +4415,7 @@ generates a DSA key using the parameters in the file
4475.Ar file . 4415.Ar file .
4476.It Fl key Ar file 4416.It Fl key Ar file
4477This specifies the file to read the private key from. 4417This specifies the file to read the private key from.
4478It also accepts PKCS#8 format private keys for 4418It also accepts PKCS#8 format private keys for PEM format files.
4479.Em PEM
4480format files.
4481.It Fl keyform Ar DER | PEM 4419.It Fl keyform Ar DER | PEM
4482The format of the private key file specified in the 4420The format of the private key file specified in the
4483.Fl key 4421.Fl key
@@ -4581,9 +4519,8 @@ SET OF, whereas the correct form does.
4581.Pp 4519.Pp
4582It should be noted that very few CAs still require the use of this option. 4520It should be noted that very few CAs still require the use of this option.
4583.It Fl newhdr 4521.It Fl newhdr
4584Adds the word NEW to the 4522Adds the word NEW to the PEM file header and footer lines
4585.Em PEM 4523on the outputed request.
4586file header and footer lines on the outputed request.
4587Some software 4524Some software
4588.Pq Netscape certificate server 4525.Pq Netscape certificate server
4589and some CAs need this. 4526and some CAs need this.
@@ -4953,9 +4890,7 @@ Sample configuration containing all field values:
4953\& challengePassword = A challenge password 4890\& challengePassword = A challenge password
4954.Ed 4891.Ed
4955.Sh REQ NOTES 4892.Sh REQ NOTES
4956The header and footer lines in the 4893The header and footer lines in the PEM format are normally:
4957.Ar PEM
4958format are normally:
4959.Bd -unfilled -offset indent 4894.Bd -unfilled -offset indent
4960-----BEGIN CERTIFICATE REQUEST----- 4895-----BEGIN CERTIFICATE REQUEST-----
4961-----END CERTIFICATE REQUEST----- 4896-----END CERTIFICATE REQUEST-----
@@ -5105,12 +5040,12 @@ This specifies the input format.
5105The 5040The
5106.Ar DER 5041.Ar DER
5107argument 5042argument
5108uses an ASN1 DER encoded form compatible with the PKCS#1 5043uses an ASN1 DER-encoded form compatible with the PKCS#1
5109RSAPrivateKey or SubjectPublicKeyInfo format. 5044RSAPrivateKey or SubjectPublicKeyInfo format.
5110The 5045The
5111.Ar PEM 5046.Ar PEM
5112form is the default format: it consists of the DER format base64 5047form is the default format: it consists of the DER format base64-encoded with
5113encoded with additional header and footer lines. 5048additional header and footer lines.
5114On input PKCS#8 format private keys are also accepted. 5049On input PKCS#8 format private keys are also accepted.
5115The 5050The
5116.Ar NET 5051.Ar NET
@@ -5124,7 +5059,7 @@ option.
5124.It Fl in Ar file 5059.It Fl in Ar file
5125This specifies the input 5060This specifies the input
5126.Ar file 5061.Ar file
5127to read a key from or standard input if this 5062to read a key from, or standard input if this
5128option is not specified. 5063option is not specified.
5129If the key is encrypted, a pass phrase will be prompted for. 5064If the key is encrypted, a pass phrase will be prompted for.
5130.It Fl passin Ar arg 5065.It Fl passin Ar arg
@@ -5166,9 +5101,7 @@ This means that using the
5166utility to read in an encrypted key with no encryption option can be used 5101utility to read in an encrypted key with no encryption option can be used
5167to remove the pass phrase from a key, or by setting the encryption options 5102to remove the pass phrase from a key, or by setting the encryption options
5168it can be used to add or change the pass phrase. 5103it can be used to add or change the pass phrase.
5169These options can only be used with 5104These options can only be used with PEM format output files.
5170.Ar PEM
5171format output files.
5172.It Fl text 5105.It Fl text
5173Prints out the various public or private key components in 5106Prints out the various public or private key components in
5174plain text, in addition to the encoded version. 5107plain text, in addition to the encoded version.
@@ -5195,17 +5128,13 @@ thus initialising it if needed.
5195The engine will then be set as the default for all available algorithms. 5128The engine will then be set as the default for all available algorithms.
5196.El 5129.El
5197.Sh RSA NOTES 5130.Sh RSA NOTES
5198The 5131The PEM private key format uses the header and footer lines:
5199.Em PEM
5200private key format uses the header and footer lines:
5201.Bd -unfilled -offset indent 5132.Bd -unfilled -offset indent
5202-----BEGIN RSA PRIVATE KEY----- 5133-----BEGIN RSA PRIVATE KEY-----
5203-----END RSA PRIVATE KEY----- 5134-----END RSA PRIVATE KEY-----
5204.Ed 5135.Ed
5205.Pp 5136.Pp
5206The 5137The PEM public key format uses the header and footer lines:
5207.Em PEM
5208public key format uses the header and footer lines:
5209.Bd -unfilled -offset indent 5138.Bd -unfilled -offset indent
5210-----BEGIN PUBLIC KEY----- 5139-----BEGIN PUBLIC KEY-----
5211-----END PUBLIC KEY----- 5140-----END PUBLIC KEY-----
@@ -5243,11 +5172,7 @@ To encrypt a private key using triple DES:
5243.Pp 5172.Pp
5244.Dl $ openssl rsa -in key.pem -des3 -out keyout.pem 5173.Dl $ openssl rsa -in key.pem -des3 -out keyout.pem
5245.Pp 5174.Pp
5246To convert a private key from 5175To convert a private key from PEM to DER format:
5247.Em PEM
5248to
5249.Em DER
5250format:
5251.Pp 5176.Pp
5252.Dl $ openssl rsa -in key.pem -outform DER -out keyout.der 5177.Dl $ openssl rsa -in key.pem -outform DER -out keyout.der
5253.Pp 5178.Pp
@@ -5297,12 +5222,12 @@ The options are as follows:
5297.It Fl in Ar file 5222.It Fl in Ar file
5298This specifies the input 5223This specifies the input
5299.Ar file 5224.Ar file
5300to read data from or standard input 5225to read data from, or standard input
5301if this option is not specified. 5226if this option is not specified.
5302.It Fl out Ar file 5227.It Fl out Ar file
5303Specifies the output 5228Specifies the output
5304.Ar file 5229.Ar file
5305to write to or standard output by 5230to write to, or standard output by
5306default. 5231default.
5307.It Fl inkey Ar file 5232.It Fl inkey Ar file
5308The input key file, by default it should be an RSA private key. 5233The input key file, by default it should be an RSA private key.
@@ -6033,13 +5958,13 @@ The options are as follows:
6033This specifies the input format. 5958This specifies the input format.
6034The 5959The
6035.Ar DER 5960.Ar DER
6036argument uses an ASN1 DER encoded 5961argument uses an ASN1 DER-encoded
6037format containing session details. 5962format containing session details.
6038The precise format can vary from one version to the next. 5963The precise format can vary from one version to the next.
6039The 5964The
6040.Ar PEM 5965.Ar PEM
6041form is the default format: it consists of the DER 5966form is the default format: it consists of the DER
6042format base64 encoded with additional header and footer lines. 5967format base64-encoded with additional header and footer lines.
6043.It Fl outform Ar DER | PEM 5968.It Fl outform Ar DER | PEM
6044This specifies the output format; the options have the same meaning as the 5969This specifies the output format; the options have the same meaning as the
6045.Fl inform 5970.Fl inform
@@ -6113,9 +6038,7 @@ The timeout in seconds.
6113This is the return code when an SSL client certificate is verified. 6038This is the return code when an SSL client certificate is verified.
6114.El 6039.El
6115.Sh SESS_ID NOTES 6040.Sh SESS_ID NOTES
6116The 6041The PEM-encoded session format uses the header and footer lines:
6117.Em PEM
6118encoded session format uses the header and footer lines:
6119.Bd -unfilled -offset indent 6042.Bd -unfilled -offset indent
6120-----BEGIN SSL SESSION PARAMETERS----- 6043-----BEGIN SSL SESSION PARAMETERS-----
6121-----END SSL SESSION PARAMETERS----- 6044-----END SSL SESSION PARAMETERS-----
@@ -6216,9 +6139,7 @@ Verify signed mail.
6216Expects a signed mail message on input and outputs the signed data. 6139Expects a signed mail message on input and outputs the signed data.
6217Both clear text and opaque signing is supported. 6140Both clear text and opaque signing is supported.
6218.It Fl pk7out 6141.It Fl pk7out
6219Takes an input message and writes out a 6142Takes an input message and writes out a PEM-encoded PKCS#7 structure.
6220.Em PEM
6221encoded PKCS#7 structure.
6222.It Fl in Ar file 6143.It Fl in Ar file
6223The input message to be encrypted or signed or the 6144The input message to be encrypted or signed or the
6224.Em MIME 6145.Em MIME
@@ -6231,9 +6152,9 @@ The default is
6231which reads an 6152which reads an
6232.Em S/MIME 6153.Em S/MIME
6233format message. 6154format message.
6234.Em PEM 6155.Ar PEM
6235and 6156and
6236.Em DER 6157.Ar DER
6237format change this to expect PEM and DER format PKCS#7 structures 6158format change this to expect PEM and DER format PKCS#7 structures
6238instead. 6159instead.
6239This currently only affects the input format of the PKCS#7 6160This currently only affects the input format of the PKCS#7
@@ -6253,9 +6174,9 @@ The default is
6253which writes an 6174which writes an
6254.Em S/MIME 6175.Em S/MIME
6255format message. 6176format message.
6256.Em PEM 6177.Ar PEM
6257and 6178and
6258.Em DER 6179.Ar DER
6259format change this to write PEM and DER format PKCS#7 structures 6180format change this to write PEM and DER format PKCS#7 structures
6260instead. 6181instead.
6261This currently only affects the output format of the PKCS#7 6182This currently only affects the output format of the PKCS#7
@@ -6361,9 +6282,7 @@ type multipart/signed is used.
6361Allows additional certificates to be specified. 6282Allows additional certificates to be specified.
6362When signing these will be included with the message. 6283When signing these will be included with the message.
6363When verifying these will be searched for the signers' certificates. 6284When verifying these will be searched for the signers' certificates.
6364The certificates should be in 6285The certificates should be in PEM format.
6365.Em PEM
6366format.
6367.It Fl signer Ar file 6286.It Fl signer Ar file
6368The signer's certificate when signing a message. 6287The signer's certificate when signing a message.
6369If a message is being verified, then the signer's certificates will be 6288If a message is being verified, then the signer's certificates will be
@@ -6555,7 +6474,7 @@ $ openssl smime -decrypt -in mail.msg -recip mycert.pem \e
6555The output from Netscape form signing is a PKCS#7 structure with the 6474The output from Netscape form signing is a PKCS#7 structure with the
6556detached signature format. 6475detached signature format.
6557You can use this program to verify the signature by line wrapping the 6476You can use this program to verify the signature by line wrapping the
6558base64 encoded structure and surrounding it with: 6477base64-encoded structure and surrounding it with:
6559.Bd -unfilled -offset indent 6478.Bd -unfilled -offset indent
6560-----BEGIN PKCS7----- 6479-----BEGIN PKCS7-----
6561-----END PKCS7----- 6480-----END PKCS7-----
@@ -6703,14 +6622,14 @@ The options are as follows:
6703.It Fl in Ar file 6622.It Fl in Ar file
6704This specifies the input 6623This specifies the input
6705.Ar file 6624.Ar file
6706to read from or standard input if this option is not specified. 6625to read from, or standard input if this option is not specified.
6707Ignored if the 6626Ignored if the
6708.Fl key 6627.Fl key
6709option is used. 6628option is used.
6710.It Fl out Ar file 6629.It Fl out Ar file
6711Specifies the output 6630Specifies the output
6712.Ar file 6631.Ar file
6713to write to or standard output by default. 6632to write to, or standard output by default.
6714.It Fl key Ar keyfile 6633.It Fl key Ar keyfile
6715Create an SPKAC file using the private key in 6634Create an SPKAC file using the private key in
6716.Ar keyfile . 6635.Ar keyfile .
@@ -6843,9 +6762,7 @@ A
6843of trusted certificates. 6762of trusted certificates.
6844The 6763The
6845.Ar file 6764.Ar file
6846should contain multiple certificates in 6765should contain multiple certificates in PEM format, concatenated together.
6847.Em PEM
6848format concatenated together.
6849.It Fl untrusted Ar file 6766.It Fl untrusted Ar file
6850A 6767A
6851.Ar file 6768.Ar file
@@ -6896,9 +6813,7 @@ One or more
6896to verify. 6813to verify.
6897If no certificate files are included, then an attempt is made to read 6814If no certificate files are included, then an attempt is made to read
6898a certificate from standard input. 6815a certificate from standard input.
6899They should all be in 6816They should all be in PEM format.
6900.Em PEM
6901format.
6902.El 6817.El
6903.Sh VERIFY OPERATION 6818.Sh VERIFY OPERATION
6904The 6819The
@@ -7279,11 +7194,11 @@ option.
7279.It Fl in Ar file 7194.It Fl in Ar file
7280This specifies the input 7195This specifies the input
7281.Ar file 7196.Ar file
7282to read a certificate from or standard input if this option is not specified. 7197to read a certificate from, or standard input if this option is not specified.
7283.It Fl out Ar file 7198.It Fl out Ar file
7284This specifies the output 7199This specifies the output
7285.Ar file 7200.Ar file
7286to write to or standard output by default. 7201to write to, or standard output by default.
7287.It Fl passin Ar arg 7202.It Fl passin Ar arg
7288The key password source. 7203The key password source.
7289For more information about the format of 7204For more information about the format of
@@ -7385,7 +7300,7 @@ date.
7385.It Fl dates 7300.It Fl dates
7386Prints out the start and expiry dates of a certificate. 7301Prints out the start and expiry dates of a certificate.
7387.It Fl fingerprint 7302.It Fl fingerprint
7388Prints out the digest of the DER encoded version of the whole certificate 7303Prints out the digest of the DER-encoded version of the whole certificate
7389(see 7304(see
7390.Sx DIGEST OPTIONS ) . 7305.Sx DIGEST OPTIONS ) .
7391.It Fl C 7306.It Fl C
@@ -7859,11 +7774,7 @@ Display the certificate SHA1 fingerprint:
7859.Pp 7774.Pp
7860.Dl $ openssl x509 -sha1 -in cert.pem -noout -fingerprint 7775.Dl $ openssl x509 -sha1 -in cert.pem -noout -fingerprint
7861.Pp 7776.Pp
7862Convert a certificate from 7777Convert a certificate from PEM to DER format:
7863.Em PEM
7864to
7865.Em DER
7866format:
7867.Pp 7778.Pp
7868.Dl "$ openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER" 7779.Dl "$ openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER"
7869.Pp 7780.Pp
@@ -7895,9 +7806,7 @@ $ openssl x509 -in cert.pem -addtrust clientAuth \e
7895 -setalias "Steve's Class 1 CA" -out trust.pem 7806 -setalias "Steve's Class 1 CA" -out trust.pem
7896.Ed 7807.Ed
7897.Sh X509 NOTES 7808.Sh X509 NOTES
7898The 7809The PEM format uses the header and footer lines:
7899.Em PEM
7900format uses the header and footer lines:
7901.Bd -unfilled -offset indent 7810.Bd -unfilled -offset indent
7902-----BEGIN CERTIFICATE----- 7811-----BEGIN CERTIFICATE-----
7903-----END CERTIFICATE----- 7812-----END CERTIFICATE-----
@@ -7923,7 +7832,7 @@ it is more likely to display the majority of certificates correctly.
7923.Pp 7832.Pp
7924The 7833The
7925.Fl fingerprint 7834.Fl fingerprint
7926option takes the digest of the DER encoded certificate. 7835option takes the digest of the DER-encoded certificate.
7927This is commonly called a 7836This is commonly called a
7928.Qq fingerprint . 7837.Qq fingerprint .
7929Because of the nature of message digests, the fingerprint of a certificate 7838Because of the nature of message digests, the fingerprint of a certificate