{@inhertidoc}.
@param null|mixed $password
433680
public function withUserInfo($user, $password = null): self
    {
        $user_info = null;
        $user = $this->filterString($user);
        if (null !== $password) {
            $password = $this->filterString($password);
        }

        if ('' !== $user) {
            $user_info = $this->formatUserInfo($user, $password);
        }

        if ($user_info === $this->user_info) {
            return $this;
        }

        $clone = clone $this;
        $clone->user_info = $user_info;
        $clone->authority = $clone->setAuthority();
        $clone->assertValidState();

        return $clone;
    }
1098845
public function setAuth($username = null, $password = null)
    {
        $this->username = $username;
        $this->password = $password;
    }
896105
public void setPassword(char[] password) {

        LettuceAssert.notNull(password, "Password must not be null");
        this.password = Arrays.copyOf(password, password.length);
    }
667378
private static function loadKeyFromDER($der, $password = null)
    {
        $pem = self::convertDerToPem($der);

        return self::loadKeyFromPEM($pem, $password);
    }
896173
public function hash(string $password): string
    {
        if ('' === $password) {
            throw EmptyPasswordException::create();
        }

        return password_hash($password, PASSWORD_DEFAULT);
    }
902672
private function _hashPassword($password = null)
    {
        if (null !== $password) {
            $this->password = md5($password);
        }

        return $this->password;
    }
168463
public function setPassword(string $password): User
    {
        DB::table('user')
            ->where('user_id', '=', $this->user_id)
            ->update([
                'password' => password_hash($password, PASSWORD_DEFAULT),
            ]);

        return $this;
    }
794777
static function validatePassword( $password )
    {
        $ini = eZINI::instance();
        $minPasswordLength = $ini->variable( 'UserSettings', 'MinPasswordLength' );
        if ( $password !== false and
             $password !== null and
             strlen( $password ) >= (int) $minPasswordLength )
        {
            return true;
        }

        return false;
    }
309725
public function setPlainPassword($password)
    {
        $this['salt'] || $this['salt'] = $this->password->generateSalt();
        $this['password'] = $this->password->hash($password, $this['salt']);

        return $this;
    }
264110
public function checkPassword(string $password): bool
    {
        $password_hash = DB::table('user')
            ->where('user_id', '=', $this->id())
            ->value('password');

        if ($password_hash !== null && password_verify($password, $password_hash)) {
            if (password_needs_rehash($password_hash, PASSWORD_DEFAULT)) {
                $this->setPassword($password);
            }

            return true;
        }

        return false;
    }
1059915
protected function resetPassword($user, $password) {
        $user->password = bcrypt($password);
        $user->save();

        Auth::login($user);
    }
15305
protected function fillPassword(string $password): void
    {
        $this->context->findElement($this->fields['password'], $this->defaultTimeout)->setValue($password);
    }
1010377
public function sign($key, $password = null)
    {
        OpenSslException::reset();

        if (false === extension_loaded('openssl')) {
            // @codeCoverageIgnoreStart
            throw OpenSslException::create(
                'The "openssl" extension is not available.'
            );
            // @codeCoverageIgnoreEnd
        }

        if (false === ($resource = openssl_pkey_get_private($key, $password))) {
            // @codeCoverageIgnoreStart
            throw OpenSslException::lastError();
            // @codeCoverageIgnoreEnd
        }

        if (false === openssl_pkey_export($resource, $private)) {
            // @codeCoverageIgnoreStart
            throw OpenSslException::lastError();
            // @codeCoverageIgnoreEnd
        }

        if (false === ($details = openssl_pkey_get_details($resource))) {
            // @codeCoverageIgnoreStart
            throw OpenSslException::lastError();
            // @codeCoverageIgnoreEnd
        }

        $this->phar->setSignatureAlgorithm(Phar::OPENSSL, $private);

        if (false === @file_put_contents($this->file . '.pubkey', $details['key'])) {
            throw FileException::lastError();
        }
    }
619700
public function password(string $defaultPassword = null)
    {
        if (!$this->parsedUri->hasUser()) {
            return null;
        }

        if ($this->parsedUri->hasPassword()) {
            return $this->parsedUri->password();
        }

        return $defaultPassword;
    }
1332848
protected function resetPassword($user, $password)
    {
        $user->forceFill([
            'password' => bcrypt($password),
            'remember_token' => Str::random(60),
        ])->save();

        $this->guard()->login($user);
    }
205072
public function login($password)
    {
        if (!$this->exists() ||
            !$this->verifyLogin($password) ||
            $this->someOneLoggedIn()
        ) {
            return false;
        }

        if ($this->lastLoginStatement === null) {
            $this->lastLoginStatement = $this->connection->prepare("UPDATE User SET lastLogin = FROM_UNIXTIME(?) WHERE username = ?");
            $this->lastLoginStatement->bindParam(1, $this->lastLogin);
            $this->lastLoginStatement->bindParam(2, $this->username);

        }
        $this->lastLogin = time();
        $this->lastLoginStatement->execute();


        $this->updateLoginSession();
        $this->notifyObservers(User::EVENT_LOGIN);
        return true;
    }
917251
public function setPassword($password)
    {
      if(!is_string($password) && strlen(trim($password)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid password, must be a non empty string');

      $this->password = $password;
    }