Rev 846 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 846 | Rev 874 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | * Technically, PKCS1 is for RSA keys, only, but we're using PKCS1 to describe |
15 | * Technically, PKCS1 is for RSA keys, only, but we're using PKCS1 to describe |
16 | * DSA, whose format isn't really formally described anywhere, so might as well |
16 | * DSA, whose format isn't really formally described anywhere, so might as well |
17 | * use it to describe this, too. PKCS1 is easier to remember than RFC5915, after |
17 | * use it to describe this, too. PKCS1 is easier to remember than RFC5915, after |
18 | * all. I suppose this could also be named IETF but idk |
18 | * all. I suppose this could also be named IETF but idk |
19 | * |
19 | * |
- | 20 | * @category Crypt |
|
- | 21 | * @package EC |
|
20 | * @author Jim Wigginton <terrafrost@php.net> |
22 | * @author Jim Wigginton <terrafrost@php.net> |
21 | * @copyright 2015 Jim Wigginton |
23 | * @copyright 2015 Jim Wigginton |
22 | * @license http://www.opensource.org/licenses/mit-license.html MIT License |
24 | * @license http://www.opensource.org/licenses/mit-license.html MIT License |
23 | * @link http://phpseclib.sourceforge.net |
25 | * @link http://phpseclib.sourceforge.net |
24 | */ |
26 | */ |
Line 37... | Line 39... | ||
37 | use phpseclib3\Math\BigInteger; |
39 | use phpseclib3\Math\BigInteger; |
38 | 40 | ||
39 | /** |
41 | /** |
40 | * "PKCS1" (RFC5915) Formatted EC Key Handler |
42 | * "PKCS1" (RFC5915) Formatted EC Key Handler |
41 | * |
43 | * |
- | 44 | * @package EC |
|
42 | * @author Jim Wigginton <terrafrost@php.net> |
45 | * @author Jim Wigginton <terrafrost@php.net> |
- | 46 | * @access public |
|
43 | */ |
47 | */ |
44 | abstract class PKCS1 extends Progenitor |
48 | abstract class PKCS1 extends Progenitor |
45 | { |
49 | { |
46 | use Common; |
50 | use Common; |
47 | 51 | ||
48 | /** |
52 | /** |
49 | * Break a public or private key down into its constituent components |
53 | * Break a public or private key down into its constituent components |
50 | * |
54 | * |
- | 55 | * @access public |
|
51 | * @param string $key |
56 | * @param string $key |
52 | * @param string $password optional |
57 | * @param string $password optional |
53 | * @return array |
58 | * @return array |
54 | */ |
59 | */ |
55 | public static function load($key, $password = '') |
60 | public static function load($key, $password = '') |
Line 141... | Line 146... | ||
141 | } |
146 | } |
142 | 147 | ||
143 | /** |
148 | /** |
144 | * Convert EC parameters to the appropriate format |
149 | * Convert EC parameters to the appropriate format |
145 | * |
150 | * |
- | 151 | * @access public |
|
146 | * @return string |
152 | * @return string |
147 | */ |
153 | */ |
148 | public static function saveParameters(BaseCurve $curve, array $options = []) |
154 | public static function saveParameters(BaseCurve $curve, array $options = []) |
149 | { |
155 | { |
150 | self::initialize_static_variables(); |
156 | self::initialize_static_variables(); |
Line 161... | Line 167... | ||
161 | } |
167 | } |
162 | 168 | ||
163 | /** |
169 | /** |
164 | * Convert a private key to the appropriate format. |
170 | * Convert a private key to the appropriate format. |
165 | * |
171 | * |
- | 172 | * @access public |
|
166 | * @param \phpseclib3\Math\BigInteger $privateKey |
173 | * @param \phpseclib3\Math\BigInteger $privateKey |
167 | * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve |
174 | * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve |
168 | * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey |
175 | * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey |
169 | * @param string $password optional |
176 | * @param string $password optional |
170 | * @param array $options optional |
177 | * @param array $options optional |