Psecio\Jwt\Header::__construct PHP Метод

__construct() публичный Метод

Intitialize the Header
public __construct ( string $key, string $algorithm = 'HS256', string $type = 'JWT' )
$key string Key to use for encoding
$algorithm string Algorithm to use [optional]
$type string Type of object [optional]
    public function __construct($key, $algorithm = 'HS256', $type = 'JWT')
    {
        $this->setType($type);
        $this->setAlgorithm($algorithm);
        $this->setKey($key);
        // If it's a certificate, we're a JWS instead
        if (is_resource($key)) {
            $this->setType('JWS');
        }
    }