PHP 클래스 Lcobucci\JWT\Token

부터: 0.1.0
저자: Luís Otávio Cobucci Oblonczyk ([email protected])
파일 보기 프로젝트 열기: lcobucci/jwt 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( array $headers = ['alg' => 'none'], array $claims = [], Lcobucci\JWT\Signature $signature = null, array $payload = ['', ''] ) Initializes the object
__toString ( ) : string Returns an encoded representation of the token
getClaim ( string $name, mixed $default = null ) : mixed Returns the value of a token claim
getClaims ( ) : array Returns the token claim set
getHeader ( string $name, mixed $default = null ) : mixed Returns the value of a token header
getHeaders ( ) : array Returns the token headers
getPayload ( ) : string Returns the token payload
hasClaim ( string $name ) : boolean Returns if the claim is configured
hasHeader ( string $name ) : boolean Returns if the header is configured
isExpired ( DateTimeInterfac\DateTimeInterface $now = null ) : boolean Determine if the token is expired.
validate ( ValidationData $data ) : boolean Validates if the token is valid
verify ( Lcobucci\JWT\Signer $signer, Lcobucci\JWT\Signer\Key | string $key ) : boolean Verify if the key matches with the one that created the signature

비공개 메소드들

메소드 설명
getHeaderValue ( string $name ) : mixed Returns the value stored in header
getValidatableClaims ( ) : Generator Yields the validatable claims

메소드 상세

__construct() 공개 메소드

Initializes the object
public __construct ( array $headers = ['alg' => 'none'], array $claims = [], Lcobucci\JWT\Signature $signature = null, array $payload = ['', ''] )
$headers array
$claims array
$signature Lcobucci\JWT\Signature
$payload array

__toString() 공개 메소드

Returns an encoded representation of the token
public __toString ( ) : string
리턴 string

getClaim() 공개 메소드

Returns the value of a token claim
public getClaim ( string $name, mixed $default = null ) : mixed
$name string
$default mixed
리턴 mixed

getClaims() 공개 메소드

Returns the token claim set
public getClaims ( ) : array
리턴 array

getHeader() 공개 메소드

Returns the value of a token header
public getHeader ( string $name, mixed $default = null ) : mixed
$name string
$default mixed
리턴 mixed

getHeaders() 공개 메소드

Returns the token headers
public getHeaders ( ) : array
리턴 array

getPayload() 공개 메소드

Returns the token payload
public getPayload ( ) : string
리턴 string

hasClaim() 공개 메소드

Returns if the claim is configured
public hasClaim ( string $name ) : boolean
$name string
리턴 boolean

hasHeader() 공개 메소드

Returns if the header is configured
public hasHeader ( string $name ) : boolean
$name string
리턴 boolean

isExpired() 공개 메소드

Determine if the token is expired.
public isExpired ( DateTimeInterfac\DateTimeInterface $now = null ) : boolean
$now DateTimeInterfac\DateTimeInterface Defaults to the current time.
리턴 boolean

validate() 공개 메소드

Validates if the token is valid
public validate ( ValidationData $data ) : boolean
$data ValidationData
리턴 boolean

verify() 공개 메소드

Verify if the key matches with the one that created the signature
public verify ( Lcobucci\JWT\Signer $signer, Lcobucci\JWT\Signer\Key | string $key ) : boolean
$signer Lcobucci\JWT\Signer
$key Lcobucci\JWT\Signer\Key | string
리턴 boolean