class Lcobucci extends Provider implements ProviderContract

Constants

ALGO_HS256

ALGO_HS384

ALGO_HS512

ALGO_RS256

ALGO_RS384

ALGO_RS512

ALGO_ES256

ALGO_ES384

ALGO_ES512

Properties

protected Signer $signer \Lcobucci\JWT\Signer.
protected Configuration $config \Lcobucci\JWT\Configuration.
protected array $signers

Signers that this provider supports.

Methods

__construct(string $secret, string $algo, array $keys, Configuration|null $config = null)

Create the Lcobucci provider.

setAlgo(string $algo)

Set the algorithm used to sign the token.

from  Provider
string
getAlgo()

Get the algorithm used to sign the token.

from  Provider
setSecret(string $secret)

Set the secret used to sign the token.

from  Provider
string
getSecret()

Get the secret used to sign the token.

from  Provider
setKeys(array $keys)

Set the keys used to sign the token.

from  Provider
array
getKeys()

Get the array of keys used to sign tokens with an asymmetric algorithm.

from  Provider
string|null
getPublicKey()

Get the public key used to sign tokens with an asymmetric algorithm.

from  Provider
string|null
getPrivateKey()

Get the private key used to sign tokens with an asymmetric algorithm.

from  Provider
string|null
getPassphrase()

Get the passphrase used to sign tokens with an asymmetric algorithm.

from  Provider
mixed
getSigningKey()

No description

mixed
getVerificationKey()

No description

bool
isAsymmetric()

Determine if the algorithm is asymmetric, and thus requires a public/private key combo.

void
onConfigurationChanged()

Rebuild cached derived state after a configuration change.

string
encode(array $payload)

Create a JSON Web Token.

array
decode(string $token)

Decode a JSON Web Token.

Builder
getBuilderFromClaims(array $payload)

Create an instance of the builder with all of the claims applied.

Configuration
buildConfig()

Build the configuration.

Signer
getSigner()

Get the signer instance.

Key
getKey(string $contents, string $passphrase = '')

Get the signing key instance.

Details

at line 40
__construct(string $secret, string $algo, array $keys, Configuration|null $config = null)

Create the Lcobucci provider.

Parameters

string $secret
string $algo
array $keys
Configuration|null $config

in Provider at line 47
Provider setAlgo(string $algo)

Set the algorithm used to sign the token.

Boot-only. Providers are cached on the singleton JwtManager; runtime mutation affects every subsequent request and races across coroutines.

Parameters

string $algo

Return Value

Provider

in Provider at line 58
string getAlgo()

Get the algorithm used to sign the token.

Return Value

string

in Provider at line 71
Provider setSecret(string $secret)

Set the secret used to sign the token.

Boot-only. Providers are cached on the singleton JwtManager; runtime mutation affects every subsequent request and races across coroutines.

Parameters

string $secret

Return Value

Provider

in Provider at line 82
string getSecret()

Get the secret used to sign the token.

Return Value

string

in Provider at line 95
Provider setKeys(array $keys)

Set the keys used to sign the token.

Boot-only. Providers are cached on the singleton JwtManager; runtime mutation affects every subsequent request and races across coroutines.

Parameters

array $keys

Return Value

Provider

in Provider at line 106
array getKeys()

Get the array of keys used to sign tokens with an asymmetric algorithm.

Return Value

array

in Provider at line 114
string|null getPublicKey()

Get the public key used to sign tokens with an asymmetric algorithm.

Return Value

string|null

in Provider at line 122
string|null getPrivateKey()

Get the private key used to sign tokens with an asymmetric algorithm.

Return Value

string|null

in Provider at line 131
string|null getPassphrase()

Get the passphrase used to sign tokens with an asymmetric algorithm.

Return Value

string|null

at line 213
protected mixed getSigningKey()

No description

Return Value

mixed

Exceptions

JwtException

at line 233
protected mixed getVerificationKey()

No description

Return Value

mixed

Exceptions

JwtException

at line 204
protected bool isAsymmetric()

Determine if the algorithm is asymmetric, and thus requires a public/private key combo.

Return Value

bool

at line 177
protected void onConfigurationChanged()

Rebuild cached derived state after a configuration change.

Signer is rebuilt before config because buildConfig() reads $this->signer.

Return Value

void

Exceptions

JwtException

at line 68
string encode(array $payload)

Create a JSON Web Token.

Parameters

array $payload

Return Value

string

Exceptions

JwtException

at line 86
array decode(string $token)

Decode a JSON Web Token.

Parameters

string $token

Return Value

array

Exceptions

JwtException

at line 115
protected Builder getBuilderFromClaims(array $payload)

Create an instance of the builder with all of the claims applied.

Parameters

array $payload

Return Value

Builder

at line 155
protected Configuration buildConfig()

Build the configuration.

Return Value

Configuration

at line 188
protected Signer getSigner()

Get the signer instance.

Return Value

Signer

Exceptions

JwtException

at line 253
protected Key getKey(string $contents, string $passphrase = '')

Get the signing key instance.

Parameters

string $contents
string $passphrase

Return Value

Key