PHP 클래스 Psecio\Jwt\Header

파일 보기 프로젝트 열기: psecio/jwt

공개 메소드들

메소드 설명
__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