PHP Класс Psecio\Jwt\Header

Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( string $key, string $algorithm = 'HS256', string $type = 'JWT' ) Intitialize the Header
__toString ( ) : string Convert the object to a JSON string
getAlgorithm ( boolean $resolve = false ) : string Get the current algorithm setting If "resolve" is set to true, it finds the value from the types array and returns that
getKey ( ) : string Get the currently set key
getType ( ) : string Return the current type
setAlgorithm ( string $algorithm ) : Header Set the algorithm type
setKey ( string $key ) : Header Set the current object's key value
setType ( string $type ) : Header Set the header type
toArray ( ) : array Convert the object into an array of data

Описание методов

__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]

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

Convert the object to a JSON string
public __toString ( ) : string
Результат string JSON formatted string

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

Get the current algorithm setting If "resolve" is set to true, it finds the value from the types array and returns that
public getAlgorithm ( boolean $resolve = false ) : string
$resolve boolean Resolve the algorithm to its type
Результат string Algorithm setting (or resolved value)

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

Get the currently set key
public getKey ( ) : string
Результат string Current key string

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

Return the current type
public getType ( ) : string
Результат string Current type setting

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

Set the algorithm type
public setAlgorithm ( string $algorithm ) : Header
$algorithm string Algorithm type
Результат Header instance

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

Set the current object's key value
public setKey ( string $key ) : Header
$key string Key to use for encoding
Результат Header instance

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

Set the header type
public setType ( string $type ) : Header
$type string Header type
Результат Header instance

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

Convert the object into an array of data
public toArray ( ) : array
Результат array Object data as an array