1 | <?php |
||
26 | final class ECDHES implements KeyAgreementInterface |
||
27 | { |
||
28 | /** |
||
29 | * @var \Mdanter\Ecc\Math\MathAdapterInterface |
||
30 | */ |
||
31 | private $adapter; |
||
32 | |||
33 | /** |
||
34 | * |
||
35 | */ |
||
36 | public function __construct() |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function getAgreementKey($encryption_key_length, $algorithm, JWKInterface $recipient_key, array $complete_header = [], array &$additional_header_values = []) |
||
72 | |||
73 | /** |
||
74 | * @param \Jose\Object\JWKInterface $private_key |
||
75 | * @param \Jose\Object\JWKInterface $public_key |
||
76 | * |
||
77 | * @throws \InvalidArgumentException |
||
78 | * |
||
79 | * @return int|string|void |
||
80 | */ |
||
81 | public function calculateAgreementKey(JWKInterface $private_key, JWKInterface $public_key) |
||
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | public function getAlgorithmName() |
||
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | public function getKeyManagementMode() |
||
113 | |||
114 | /** |
||
115 | * @param array $complete_header |
||
116 | * |
||
117 | * @return \Jose\Object\JWKInterface |
||
118 | */ |
||
119 | private function getPublicKey(array $complete_header) |
||
129 | |||
130 | /** |
||
131 | * @param \Jose\Object\JWKInterface $key |
||
132 | * @param bool $is_private |
||
133 | */ |
||
134 | private function checkKey(JWKInterface $key, $is_private) |
||
145 | |||
146 | /** |
||
147 | * @param JWKInterface $key |
||
148 | * |
||
149 | * @throws \InvalidArgumentException |
||
150 | * |
||
151 | * @return \Mdanter\Ecc\Primitives\GeneratorPoint |
||
152 | */ |
||
153 | private function getGenerator(JWKInterface $key) |
||
168 | |||
169 | /** |
||
170 | * @param $value |
||
171 | * |
||
172 | * @return int|string |
||
173 | */ |
||
174 | private function convertHexToDec($value) |
||
178 | |||
179 | /** |
||
180 | * @param $value |
||
181 | * |
||
182 | * @return int|string |
||
183 | */ |
||
184 | private function convertBase64ToDec($value) |
||
190 | |||
191 | /** |
||
192 | * @param $value |
||
193 | * |
||
194 | * @return string |
||
195 | */ |
||
196 | private function convertDecToBin($value) |
||
202 | } |
||
203 |