48 throw new \InvalidArgumentException();
51 if (!is_string(
$key)) {
52 throw new \InvalidArgumentException();
56 throw new \InvalidArgumentException();
67 parent::serialize($encoder);
68 $encoder->encodeBoolean($this->signature !== null);
69 $encoder->encodeString($this->algorithm);
70 $encoder->encodeString($this->key);
71 if ($this->signature !== null) {
72 $encoder2 = new \fpoirotte\Pssht\Wire\Encoder();
73 $encoder2->encodeString($this->algorithm);
74 $encoder2->encodeString($this->signature);
75 $encoder->encodeString($encoder2->getBuffer()->get(0));
80 protected static function unserializeSub(\
fpoirotte\Pssht\Wire\
Decoder $decoder)
86 $decoder->decodeString(),
90 $decoder2 = new \fpoirotte\Pssht\Wire\Decoder(
93 if ($decoder2->decodeString() !==
$algorithm) {
94 throw new \InvalidArgumentException();
96 $res[] = $decoder2->decodeString();
$algorithm
Public key algorithm in use (eg. "ssh-rsa" or "ssh-dss").
$method
Authentication method.
$user
User being authenticated.
$signature
Signature to prove key ownership.
serialize(\fpoirotte\Pssht\Wire\Encoder $encoder)
__construct($user, $service, $method, $algorithm, $key, $signature=null)
$service
Service to start after authentication.