public function sign($key, $password = null)
    {
        $this->signature = $this->getSigner()->sign($this->generateSigninInput(), $key, $password);
        $this->isSigned = true;

        return $this->signature;
    }
public function sign($key, $password = null)
    {
        $this->signature = $this->getSigner()->sign($this->generateSigninInput(), $key, $password);
        $this->isSigned = true;

        return $this->signature;
    }
public function sign ( $ key , $ password = null ) { $ this -> signature = $ this -> getSigner ( ) -> sign ( $ this -> generateSigninInput ( ) , $ key , $ password ) ; $ this -> isSigned = true ; return $ this -> signature ; }
Signs the JWS signininput.

@param resource|string $key
@param optional string $password

@return string
Signs the JWS signininput .