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