/** * \copydetails Base::__construct * * \param string $password * Password for the given user. * * \param string $newPassword * (optional) Set the new password for the user * to this value after authentication. * * \note * Pssht does not support password changing. * Therefore, the last argument to this method * is ignored when given. */ public function __construct($user, $service, $method, $password, $newPassword = null) { if (!is_string($password)) { throw new \InvalidArgumentException(); } if (!is_string($newPassword) && $newPassword !== null) { throw new \InvalidArgumentException(); } parent::__construct($user, $service, $method); $this->password = $password; $this->newPassword = $newPassword; }
/** * \copydetails Base::__construct * * \param string $algorithm * Public key algorithm to use. * * \param string $key * Key blob. * * \param string $signature * (optional) Signature proving ownership of the key. * This parameter MUST be omitted during the first phase * of authentication and MUST be given during the second * phase. */ public function __construct($user, $service, $method, $algorithm, $key, $signature = null) { if (!is_string($algorithm)) { throw new \InvalidArgumentException(); } if (!is_string($key)) { throw new \InvalidArgumentException(); } if (!is_string($signature) && $signature !== null) { throw new \InvalidArgumentException(); } parent::__construct($user, $service, $method); $this->algorithm = $algorithm; $this->key = $key; $this->signature = $signature; }
/** * \copydetails Base::__construct * * \param string $algorithm * Public key algorithm to use. * * \param string $key * Key blob. * * \param string $hostname * Hostname the user is connecting from. * * \param string $remoteUser * User's login on the remote machine. * * \param string $signature * Signature proving ownership of the key. */ public function __construct($user, $service, $method, $algorithm, $key, $hostname, $remoteUser, $signature) { if (!is_string($algorithm)) { throw new \InvalidArgumentException(); } if (!is_string($key)) { throw new \InvalidArgumentException(); } if (!is_string($hostname)) { throw new \InvalidArgumentException(); } if (!is_string($remoteUser)) { throw new \InvalidArgumentException(); } if (!is_string($signature)) { throw new \InvalidArgumentException(); } parent::__construct($user, $service, $method); $this->algorithm = $algorithm; $this->key = $key; $this->hostname = $hostname; $this->remoteUser = $remoteUser; $this->signature = $signature; }