Rev 846 | Rev 1042 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 846 | Rev 874 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | * |
9 | * |
10 | * -----BEGIN ENCRYPTED PRIVATE KEY----- |
10 | * -----BEGIN ENCRYPTED PRIVATE KEY----- |
11 | * -----BEGIN PRIVATE KEY----- |
11 | * -----BEGIN PRIVATE KEY----- |
12 | * -----BEGIN PUBLIC KEY----- |
12 | * -----BEGIN PUBLIC KEY----- |
13 | * |
13 | * |
- | 14 | * @category Crypt |
|
- | 15 | * @package DH |
|
14 | * @author Jim Wigginton <terrafrost@php.net> |
16 | * @author Jim Wigginton <terrafrost@php.net> |
15 | * @copyright 2015 Jim Wigginton |
17 | * @copyright 2015 Jim Wigginton |
16 | * @license http://www.opensource.org/licenses/mit-license.html MIT License |
18 | * @license http://www.opensource.org/licenses/mit-license.html MIT License |
17 | * @link http://phpseclib.sourceforge.net |
19 | * @link http://phpseclib.sourceforge.net |
18 | */ |
20 | */ |
Line 26... | Line 28... | ||
26 | use phpseclib3\Math\BigInteger; |
28 | use phpseclib3\Math\BigInteger; |
27 | 29 | ||
28 | /** |
30 | /** |
29 | * PKCS#8 Formatted DH Key Handler |
31 | * PKCS#8 Formatted DH Key Handler |
30 | * |
32 | * |
- | 33 | * @package DH |
|
31 | * @author Jim Wigginton <terrafrost@php.net> |
34 | * @author Jim Wigginton <terrafrost@php.net> |
- | 35 | * @access public |
|
32 | */ |
36 | */ |
33 | abstract class PKCS8 extends Progenitor |
37 | abstract class PKCS8 extends Progenitor |
34 | { |
38 | { |
35 | /** |
39 | /** |
36 | * OID Name |
40 | * OID Name |
37 | * |
41 | * |
38 | * @var string |
42 | * @var string |
- | 43 | * @access private |
|
39 | */ |
44 | */ |
40 | const OID_NAME = 'dhKeyAgreement'; |
45 | const OID_NAME = 'dhKeyAgreement'; |
41 | 46 | ||
42 | /** |
47 | /** |
43 | * OID Value |
48 | * OID Value |
44 | * |
49 | * |
45 | * @var string |
50 | * @var string |
- | 51 | * @access private |
|
46 | */ |
52 | */ |
47 | const OID_VALUE = '1.2.840.113549.1.3.1'; |
53 | const OID_VALUE = '1.2.840.113549.1.3.1'; |
48 | 54 | ||
49 | /** |
55 | /** |
50 | * Child OIDs loaded |
56 | * Child OIDs loaded |
51 | * |
57 | * |
52 | * @var bool |
58 | * @var bool |
- | 59 | * @access private |
|
53 | */ |
60 | */ |
54 | protected static $childOIDsLoaded = false; |
61 | protected static $childOIDsLoaded = false; |
55 | 62 | ||
56 | /** |
63 | /** |
57 | * Break a public or private key down into its constituent components |
64 | * Break a public or private key down into its constituent components |
58 | * |
65 | * |
- | 66 | * @access public |
|
59 | * @param string $key |
67 | * @param string $key |
60 | * @param string $password optional |
68 | * @param string $password optional |
61 | * @return array |
69 | * @return array |
62 | */ |
70 | */ |
63 | public static function load($key, $password = '') |
71 | public static function load($key, $password = '') |
Line 102... | Line 110... | ||
102 | } |
110 | } |
103 | 111 | ||
104 | /** |
112 | /** |
105 | * Convert a private key to the appropriate format. |
113 | * Convert a private key to the appropriate format. |
106 | * |
114 | * |
- | 115 | * @access public |
|
107 | * @param \phpseclib3\Math\BigInteger $prime |
116 | * @param \phpseclib3\Math\BigInteger $prime |
108 | * @param \phpseclib3\Math\BigInteger $base |
117 | * @param \phpseclib3\Math\BigInteger $base |
109 | * @param \phpseclib3\Math\BigInteger $privateKey |
118 | * @param \phpseclib3\Math\BigInteger $privateKey |
110 | * @param \phpseclib3\Math\BigInteger $publicKey |
119 | * @param \phpseclib3\Math\BigInteger $publicKey |
111 | * @param string $password optional |
120 | * @param string $password optional |
Line 125... | Line 134... | ||
125 | } |
134 | } |
126 | 135 | ||
127 | /** |
136 | /** |
128 | * Convert a public key to the appropriate format |
137 | * Convert a public key to the appropriate format |
129 | * |
138 | * |
- | 139 | * @access public |
|
130 | * @param \phpseclib3\Math\BigInteger $prime |
140 | * @param \phpseclib3\Math\BigInteger $prime |
131 | * @param \phpseclib3\Math\BigInteger $base |
141 | * @param \phpseclib3\Math\BigInteger $base |
132 | * @param \phpseclib3\Math\BigInteger $publicKey |
142 | * @param \phpseclib3\Math\BigInteger $publicKey |
133 | * @param array $options optional |
143 | * @param array $options optional |
134 | * @return string |
144 | * @return string |