pssht  latest
SSH server library written in PHP
RFC5656.php
1 <?php
2 
3 /*
4 * This file is part of pssht.
5 *
6 * (c) François Poirotte <clicky@erebot.net>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 
13 
18 {
20  protected $Q;
21 
22 
29  public function __construct(
30  \fpoirotte\Pssht\ECC\Point $Q
31  ) {
32  $this->Q = $Q;
33  }
34 
35  public static function getMessageId()
36  {
37  return 30;
38  }
39 
40  public function serialize(\fpoirotte\Pssht\Wire\Encoder $encoder)
41  {
42  $encoder->encodeString($this->Q->serialize(static::getCurve()));
43  return $this;
44  }
45 
46  public static function unserialize(\fpoirotte\Pssht\Wire\Decoder $decoder)
47  {
48  $point = \fpoirotte\Pssht\ECC\Point::unserialize(
49  static::getCurve(),
50  $decoder->decodeString()
51  );
52  return new static($point);
53  }
54 
62  public function getQ()
63  {
64  return $this->Q;
65  }
66 
77  protected static function getCurve()
78  {
79  throw new \RuntimeException();
80  }
81 }
$Q
Client&#39;s ephemeral public key as an EC Point.
Definition: RFC5656.php:20
static unserialize(\fpoirotte\Pssht\Wire\Decoder $decoder)
Definition: RFC5656.php:46
__construct(\fpoirotte\Pssht\ECC\Point $Q)
Definition: RFC5656.php:29
serialize(\fpoirotte\Pssht\Wire\Encoder $encoder)
Definition: RFC5656.php:40