Documentation

JwtUtils
in package

Table of Contents

b64UrlDecode()  : string
b64UrlEncode()  : string
create()  : string
emitDerPublicKey()  : string
parse()  : array<string|int, mixed>
TODO: replace this result with an object
parseDerPublicKey()  : OpenSSLAsymmetricKey
split()  : array<string|int, string>
verify()  : bool

Methods

b64UrlDecode()

public static b64UrlDecode(string $str) : string
Parameters
$str : string
Return values
string

b64UrlEncode()

public static b64UrlEncode(string $str) : string
Parameters
$str : string
Return values
string

create()

public static create(array<string|int, mixed> $header, array<string|int, mixed> $claims, OpenSSLAsymmetricKey $signingKey) : string
Parameters
$header : array<string|int, mixed>
$claims : array<string|int, mixed>
$signingKey : OpenSSLAsymmetricKey
Tags
phpstan-param

array<string, mixed> $header

phpstan-param

array<string, mixed> $claims

Return values
string

emitDerPublicKey()

public static emitDerPublicKey(OpenSSLAsymmetricKey $opensslKey) : string
Parameters
$opensslKey : OpenSSLAsymmetricKey
Return values
string

parse()

TODO: replace this result with an object

public static parse(string $token) : array<string|int, mixed>
Parameters
$token : string
Tags
phpstan-return

array{mixed[], mixed[], string}

throws
JwtException
Return values
array<string|int, mixed>

parseDerPublicKey()

public static parseDerPublicKey(string $derKey) : OpenSSLAsymmetricKey
Parameters
$derKey : string
Return values
OpenSSLAsymmetricKey

split()

public static split(string $jwt) : array<string|int, string>
Parameters
$jwt : string
Tags
phpstan-return

array{string, string, string}

throws
JwtException
Return values
array<string|int, string>

verify()

public static verify(string $jwt, OpenSSLAsymmetricKey $signingKey) : bool
Parameters
$jwt : string
$signingKey : OpenSSLAsymmetricKey
Tags
throws
JwtException
Return values
bool

Search results