summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjmc <>2016-08-23 18:54:04 +0000
committerjmc <>2016-08-23 18:54:04 +0000
commitb07ff71525109a75dd43b4e830287a7e98fb9cec (patch)
tree46a6d910bed2d282d26ca2469b59e7a6d222d93f /src
parentfb0daf44a6b06d09f47b083f78c699852579c918 (diff)
downloadopenbsd-b07ff71525109a75dd43b4e830287a7e98fb9cec.tar.gz
openbsd-b07ff71525109a75dd43b4e830287a7e98fb9cec.tar.bz2
openbsd-b07ff71525109a75dd43b4e830287a7e98fb9cec.zip
shorten pkcs12;
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/openssl.1229
1 files changed, 42 insertions, 187 deletions
diff --git a/src/usr.bin/openssl/openssl.1 b/src/usr.bin/openssl/openssl.1
index c50dc37f68..fa5d9d641b 100644
--- a/src/usr.bin/openssl/openssl.1
+++ b/src/usr.bin/openssl/openssl.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: openssl.1,v 1.58 2016/08/22 13:39:52 jmc Exp $ 1.\" $OpenBSD: openssl.1,v 1.59 2016/08/23 18:54:04 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: August 22 2016 $ 115.Dd $Mdocdate: August 23 2016 $
116.Dt OPENSSL 1 116.Dt OPENSSL 1
117.Os 117.Os
118.Sh NAME 118.Sh NAME
@@ -2657,17 +2657,10 @@ is the encryption algorithm to use;
2657valid values include des, des3, and rc2. 2657valid values include des, des3, and rc2.
2658It is recommended that des3 is used. 2658It is recommended that des3 is used.
2659.El 2659.El
2660.\"
2661.\" PKCS12
2662.\"
2663.Sh PKCS12 2660.Sh PKCS12
2664.nr nS 1 2661.nr nS 1
2665.Nm "openssl pkcs12" 2662.Nm "openssl pkcs12"
2666.Bk -words 2663.Op Fl aes128 | aes192 | aes256 | des | des3
2667.Oo
2668.Fl aes128 | aes192 | aes256 |
2669.Fl des | des3
2670.Oc
2671.Op Fl cacerts 2664.Op Fl cacerts
2672.Op Fl CAfile Ar file 2665.Op Fl CAfile Ar file
2673.Op Fl caname Ar name 2666.Op Fl caname Ar name
@@ -2700,7 +2693,6 @@ It is recommended that des3 is used.
2700.Op Fl passin Ar arg 2693.Op Fl passin Ar arg
2701.Op Fl passout Ar arg 2694.Op Fl passout Ar arg
2702.Op Fl twopass 2695.Op Fl twopass
2703.Ek
2704.nr nS 0 2696.nr nS 0
2705.Pp 2697.Pp
2706The 2698The
@@ -2708,24 +2700,16 @@ The
2708command allows PKCS#12 files 2700command allows PKCS#12 files
2709.Pq sometimes referred to as PFX files 2701.Pq sometimes referred to as PFX files
2710to be created and parsed. 2702to be created and parsed.
2711PKCS#12 files are used by several programs including Netscape, MSIE
2712and MS Outlook.
2713.Pp
2714There are a lot of options; the meaning of some depends on whether a
2715PKCS#12 file is being created or parsed.
2716By default, a PKCS#12 file is parsed; 2703By default, a PKCS#12 file is parsed;
2717a PKCS#12 file can be created by using the 2704a PKCS#12 file can be created by using the
2718.Fl export 2705.Fl export
2719option 2706option.
2720.Pq see below . 2707.Pp
2721.Sh PKCS12 PARSING OPTIONS 2708The options for parsing a PKCS12 file are as follows:
2722.Bl -tag -width "XXXX" 2709.Bl -tag -width "XXXX"
2723.It Xo 2710.It Fl aes128 | aes192 | aes256 | des | des3
2724.Fl aes128 | aes192 | aes256 | 2711Encrypt private keys
2725.Fl des | des3 2712using AES, DES, or triple DES, respectively.
2726.Xc
2727Use AES, DES, or triple DES, respectively,
2728to encrypt private keys before outputting.
2729The default is triple DES. 2713The default is triple DES.
2730.It Fl cacerts 2714.It Fl cacerts
2731Only output CA certificates 2715Only output CA certificates
@@ -2734,29 +2718,25 @@ Only output CA certificates
2734Only output client certificates 2718Only output client certificates
2735.Pq not CA certificates . 2719.Pq not CA certificates .
2736.It Fl in Ar file 2720.It Fl in Ar file
2737This specifies the 2721The input file to read from,
2738.Ar file 2722or standard input if not specified.
2739of the PKCS#12 file to be parsed.
2740Standard input is used by default.
2741.It Fl info 2723.It Fl info
2742Output additional information about the PKCS#12 file structure, 2724Output additional information about the PKCS#12 file structure,
2743algorithms used, and iteration counts. 2725algorithms used, and iteration counts.
2744.It Fl nocerts 2726.It Fl nocerts
2745No certificates at all will be output. 2727Do not output certificates.
2746.It Fl nodes 2728.It Fl nodes
2747Don't encrypt the private keys at all. 2729Do not encrypt private keys.
2748.It Fl nokeys 2730.It Fl nokeys
2749No private keys will be output. 2731Do not output private keys.
2750.It Fl nomacver 2732.It Fl nomacver
2751Don't attempt to verify the integrity MAC before reading the file. 2733Do not attempt to verify the integrity MAC before reading the file.
2752.It Fl noout 2734.It Fl noout
2753This option inhibits output of the keys and certificates to the output file 2735Do not output the keys and certificates to the output file
2754version of the PKCS#12 file. 2736version of the PKCS#12 file.
2755.It Fl out Ar file 2737.It Fl out Ar file
2756The 2738The output file to write to,
2757.Ar file 2739or standard output if not specified.
2758to write certificates and private keys to, standard output by default.
2759They are all written in PEM format.
2760.It Fl passin Ar arg 2740.It Fl passin Ar arg
2761The key password source. 2741The key password source.
2762.It Fl passout Ar arg 2742.It Fl passout Ar arg
@@ -2766,32 +2746,29 @@ Prompt for separate integrity and encryption passwords: most software
2766always assumes these are the same so this option will render such 2746always assumes these are the same so this option will render such
2767PKCS#12 files unreadable. 2747PKCS#12 files unreadable.
2768.El 2748.El
2769.Sh PKCS12 FILE CREATION OPTIONS 2749.Pp
2750The options for PKCS12 file creation are as follows:
2770.Bl -tag -width "XXXX" 2751.Bl -tag -width "XXXX"
2771.It Fl CAfile Ar file 2752.It Fl CAfile Ar file
2772CA storage as a file. 2753CA storage as a file.
2773.It Fl CApath Ar directory 2754.It Fl CApath Ar directory
2774CA storage as a directory. 2755CA storage as a directory.
2775This directory must be a standard certificate directory: 2756The directory must be a standard certificate directory:
2776that is, a hash of each subject name (using 2757that is, a hash of each subject name (using
2777.Cm x509 -hash ) 2758.Nm x509 Fl hash )
2778should be linked to each certificate. 2759should be linked to each certificate.
2779.It Fl caname Ar name 2760.It Fl caname Ar name
2780This specifies the 2761Specify the
2781.Qq friendly name 2762.Qq friendly name
2782for other certificates. 2763for other certificates.
2783This option may be used multiple times to specify names for all certificates 2764May be used multiple times to specify names for all certificates
2784in the order they appear. 2765in the order they appear.
2785Netscape ignores friendly names on other certificates,
2786whereas MSIE displays them.
2787.It Fl certfile Ar file 2766.It Fl certfile Ar file
2788A file to read additional certificates from. 2767A file to read additional certificates from.
2789.It Fl certpbe Ar alg , Fl keypbe Ar alg 2768.It Fl certpbe Ar alg , Fl keypbe Ar alg
2790These options allow the algorithm used to encrypt the private key and 2769Specify the algorithm used to encrypt the private key and
2791certificates to be selected. 2770certificates to be selected.
2792Any PKCS#5 v1.5 or PKCS#12 PBE algorithm name can be used (see the 2771Any PKCS#5 v1.5 or PKCS#12 PBE algorithm name can be used.
2793.Sx PKCS12 NOTES
2794section for more information).
2795If a cipher name 2772If a cipher name
2796(as output by the 2773(as output by the
2797.Cm list-cipher-algorithms 2774.Cm list-cipher-algorithms
@@ -2799,8 +2776,7 @@ command) is specified then it
2799is used with PKCS#5 v2.0. 2776is used with PKCS#5 v2.0.
2800For interoperability reasons it is advisable to only use PKCS#12 algorithms. 2777For interoperability reasons it is advisable to only use PKCS#12 algorithms.
2801.It Fl chain 2778.It Fl chain
2802If this option is present, an attempt is made to include the entire 2779Include the entire certificate chain of the user certificate.
2803certificate chain of the user certificate.
2804The standard CA store is used for this search. 2780The standard CA store is used for this search.
2805If the search fails, it is considered a fatal error. 2781If the search fails, it is considered a fatal error.
2806.It Fl CSP Ar name 2782.It Fl CSP Ar name
@@ -2815,23 +2791,20 @@ software.
2815By default, the private key is encrypted using triple DES and the 2791By default, the private key is encrypted using triple DES and the
2816certificate using 40-bit RC2. 2792certificate using 40-bit RC2.
2817.It Fl export 2793.It Fl export
2818This option specifies that a PKCS#12 file will be created rather than 2794Create a PKCS#12 file (rather than parsing one).
2819parsed.
2820.It Fl in Ar file 2795.It Fl in Ar file
2821The 2796The input file to read from,
2822.Ar file 2797or standard input if not specified,
2823to read certificates and private keys from, standard input by default. 2798in PEM format.
2824They must all be in PEM format.
2825The order doesn't matter but one private key and its corresponding 2799The order doesn't matter but one private key and its corresponding
2826certificate should be present. 2800certificate should be present.
2827If additional certificates are present, they will also be included 2801If additional certificates are present, they will also be included
2828in the PKCS#12 file. 2802in the PKCS#12 file.
2829.It Fl inkey Ar file 2803.It Fl inkey Ar file
2830File to read private key from. 2804File to read a private key from.
2831If not present, a private key must be present in the input file. 2805If not present, a private key must be present in the input file.
2832.It Fl keyex | keysig 2806.It Fl keyex | keysig
2833Specifies that the private key is to be used for key exchange or just signing. 2807Specify whether the private key is to be used for key exchange or just signing.
2834This option is only interpreted by MSIE and similar MS software.
2835Normally, 2808Normally,
2836.Qq export grade 2809.Qq export grade
2837software will only allow 512-bit RSA keys to be 2810software will only allow 512-bit RSA keys to be
@@ -2841,24 +2814,23 @@ The
2841option marks the key for signing only. 2814option marks the key for signing only.
2842Signing only keys can be used for S/MIME signing, authenticode 2815Signing only keys can be used for S/MIME signing, authenticode
2843.Pq ActiveX control signing 2816.Pq ActiveX control signing
2844and SSL client authentication; 2817and SSL client authentication.
2845however, due to a bug only MSIE 5.0 and later support
2846the use of signing only keys for SSL client authentication.
2847.It Fl macalg Ar alg 2818.It Fl macalg Ar alg
2848Specify the MAC digest algorithm. 2819Specify the MAC digest algorithm.
2849If not included then SHA1 is used. 2820The default is SHA1.
2850.It Fl maciter 2821.It Fl maciter
2851This option is included for compatibility with previous versions; it used 2822Included for compatability only:
2852to be needed to use MAC iterations counts but they are now used by default. 2823it used to be needed to use MAC iterations counts
2824but they are now used by default.
2853.It Fl name Ar name 2825.It Fl name Ar name
2854This specifies the 2826Specify the
2855.Qq friendly name 2827.Qq friendly name
2856for the certificate and private key. 2828for the certificate and private key.
2857This name is typically displayed in list boxes by software importing the file. 2829This name is typically displayed in list boxes by software importing the file.
2858.It Fl nomac 2830.It Fl nomac
2859Don't attempt to provide the MAC integrity. 2831Don't attempt to provide the MAC integrity.
2860.It Fl nomaciter , noiter 2832.It Fl nomaciter , noiter
2861These options affect the iteration counts on the MAC and key algorithms. 2833Affect the iteration counts on the MAC and key algorithms.
2862Unless you wish to produce files compatible with MSIE 4.0, you should leave 2834Unless you wish to produce files compatible with MSIE 4.0, you should leave
2863these options alone. 2835these options alone.
2864.Pp 2836.Pp
@@ -2877,130 +2849,13 @@ MSIE 4.0 doesn't support MAC iteration counts, so it needs the
2877.Fl nomaciter 2849.Fl nomaciter
2878option. 2850option.
2879.It Fl out Ar file 2851.It Fl out Ar file
2880This specifies 2852The output file to write to,
2881.Ar file 2853or standard output if not specified.
2882to write the PKCS#12 file to.
2883Standard output is used by default.
2884.It Fl passin Ar arg 2854.It Fl passin Ar arg
2885The key password source. 2855The key password source.
2886.It Fl passout Ar arg 2856.It Fl passout Ar arg
2887The output file password source. 2857The output file password source.
2888.El 2858.El
2889.Sh PKCS12 NOTES
2890Although there are a large number of options,
2891most of them are very rarely used.
2892For PKCS#12 file parsing, only
2893.Fl in
2894and
2895.Fl out
2896need to be used for PKCS#12 file creation.
2897.Fl export
2898and
2899.Fl name
2900are also used.
2901.Pp
2902If none of the
2903.Fl clcerts , cacerts ,
2904or
2905.Fl nocerts
2906options are present, then all certificates will be output in the order
2907they appear in the input PKCS#12 files.
2908There is no guarantee that the first certificate present is
2909the one corresponding to the private key.
2910Certain software which requires a private key and certificate and assumes
2911the first certificate in the file is the one corresponding to the private key:
2912this may not always be the case.
2913Using the
2914.Fl clcerts
2915option will solve this problem by only outputting the certificate
2916corresponding to the private key.
2917If the CA certificates are required, they can be output to a separate
2918file using the
2919.Fl nokeys
2920and
2921.Fl cacerts
2922options to just output CA certificates.
2923.Pp
2924The
2925.Fl keypbe
2926and
2927.Fl certpbe
2928algorithms allow the precise encryption algorithms for private keys
2929and certificates to be specified.
2930Normally, the defaults are fine but occasionally software can't handle
2931triple DES encrypted private keys;
2932then the option
2933.Fl keypbe Ar PBE-SHA1-RC2-40
2934can be used to reduce the private key encryption to 40-bit RC2.
2935A complete description of all algorithms is contained in the
2936.Sx PKCS8
2937section above.
2938.Sh PKCS12 EXAMPLES
2939Parse a PKCS#12 file and output it to a file:
2940.Pp
2941.Dl $ openssl pkcs12 -in file.p12 -out file.pem
2942.Pp
2943Output only client certificates to a file:
2944.Pp
2945.Dl $ openssl pkcs12 -in file.p12 -clcerts -out file.pem
2946.Pp
2947Don't encrypt the private key:
2948.Pp
2949.Dl $ openssl pkcs12 -in file.p12 -out file.pem -nodes
2950.Pp
2951Print some info about a PKCS#12 file:
2952.Pp
2953.Dl $ openssl pkcs12 -in file.p12 -info -noout
2954.Pp
2955Create a PKCS#12 file:
2956.Bd -literal -offset indent
2957$ openssl pkcs12 -export -in file.pem -out file.p12 \e
2958 -name "My Certificate"
2959.Ed
2960.Pp
2961Include some extra certificates:
2962.Bd -literal -offset indent
2963$ openssl pkcs12 -export -in file.pem -out file.p12 \e
2964 -name "My Certificate" -certfile othercerts.pem
2965.Ed
2966.Sh PKCS12 BUGS
2967Some would argue that the PKCS#12 standard is one big bug :\-)
2968.Pp
2969Versions of
2970.Nm OpenSSL
2971before 0.9.6a had a bug in the PKCS#12 key generation routines.
2972Under rare circumstances this could produce a PKCS#12 file encrypted
2973with an invalid key.
2974As a result some PKCS#12 files which triggered this bug
2975from other implementations
2976.Pq MSIE or Netscape
2977could not be decrypted by
2978.Nm OpenSSL
2979and similarly
2980.Nm OpenSSL
2981could produce PKCS#12 files which could not be decrypted by other
2982implementations.
2983The chances of producing such a file are relatively small: less than 1 in 256.
2984.Pp
2985A side effect of fixing this bug is that any old invalidly encrypted PKCS#12
2986files can no longer be parsed by the fixed version.
2987Under such circumstances the
2988.Nm pkcs12
2989utility will report that the MAC is OK but fail with a decryption
2990error when extracting private keys.
2991.Pp
2992This problem can be resolved by extracting the private keys and certificates
2993from the PKCS#12 file using an older version of
2994.Nm OpenSSL
2995and recreating
2996the PKCS#12 file from the keys and certificates using a newer version of
2997.Nm OpenSSL .
2998For example:
2999.Bd -literal -offset indent
3000$ old-openssl -in bad.p12 -out keycerts.pem
3001$ openssl -in keycerts.pem -export -name "My PKCS#12 file" \e
3002 -out fixed.p12
3003.Ed
3004.\" 2859.\"
3005.\" PKEY 2860.\" PKEY
3006.\" 2861.\"