Lcobucci
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|null | $config | The configuration that signs and verifies tokens. |
|
| protected bool | $verifiesOnly | Whether the provider has no private key, so it can only verify tokens. |
|
| protected array | $signers | Signers that this provider supports. |
Methods
Create the Lcobucci provider.
Get the array of keys used to sign tokens with an asymmetric algorithm.
Get the public key used to sign tokens with an asymmetric algorithm.
Get the private key used to sign tokens with an asymmetric algorithm.
Get the passphrase used to sign tokens with an asymmetric algorithm.
Get the key used to sign the tokens.
Get the key used to verify the tokens.
Determine if the algorithm is asymmetric, and thus requires a public/private key combo.
Discard the configuration after a setting changes.
Create a JSON Web Token.
Decode a JSON Web Token.
Create an instance of the builder with all of the claims applied.
Convert a date claim value to a date with whole-second precision.
Get the configuration, rebuilding it if the algorithm or keys have changed.
Discard the configuration so it and the signer are rebuilt on next use.
Build the configuration.
Build the signer, and the configuration unless one is given.
Get the signer instance.
Get the signing key instance.
Details
at line 54
__construct(string $secret, string $algo, array $keys, Configuration|null $config = null)
Create the Lcobucci provider.
A given configuration signs and verifies tokens instead of one built from the secret and keys.
in
Provider at line 51
Provider
setAlgo(string $algo)
Set the algorithm used to sign the token.
On a provider cached by the shared JwtManager, runtime mutation affects every subsequent request and races across coroutines.
in
Provider at line 63
string
getAlgo()
Get the algorithm used to sign the token.
in
Provider at line 76
Provider
setSecret(string $secret)
Set the secret used to sign the token.
On a provider cached by the shared JwtManager, runtime mutation affects every subsequent request and races across coroutines.
in
Provider at line 88
string
getSecret()
Get the secret used to sign the token.
in
Provider at line 101
Provider
setKeys(array $keys)
Set the keys used to sign the token.
On a provider cached by the shared JwtManager, runtime mutation affects every subsequent request and races across coroutines.
in
Provider at line 113
array
getKeys()
Get the array of keys used to sign tokens with an asymmetric algorithm.
in
Provider at line 121
string|null
getPublicKey()
Get the public key used to sign tokens with an asymmetric algorithm.
in
Provider at line 129
string|null
getPrivateKey()
Get the private key used to sign tokens with an asymmetric algorithm.
in
Provider at line 138
string|null
getPassphrase()
Get the passphrase used to sign tokens with an asymmetric algorithm.
at line 297
protected mixed
getSigningKey()
Get the key used to sign the tokens.
at line 323
protected mixed
getVerificationKey()
Get the key used to verify the tokens.
at line 285
protected bool
isAsymmetric()
Determine if the algorithm is asymmetric, and thus requires a public/private key combo.
at line 261
protected void
onConfigurationChanged()
Discard the configuration after a setting changes.
A configuration given to the constructor is replaced by one built from the new settings on next use, when invalid settings also raise their configuration error.
at line 87
string
encode(array $payload)
Create a JSON Web Token.
at line 111
array
decode(string $token)
Decode a JSON Web Token.
at line 146
protected Builder
getBuilderFromClaims(array $payload)
Create an instance of the builder with all of the claims applied.
at line 186
protected DateTimeImmutable
getDateFromClaim(int|string|DateTimeInterface|DateInterval $value)
Convert a date claim value to a date with whole-second precision.
at line 202
protected Configuration
config()
Get the configuration, rebuilding it if the algorithm or keys have changed.
at line 212
protected Lcobucci
resetConfig()
Discard the configuration so it and the signer are rebuilt on next use.
at line 223
protected Configuration
buildConfig()
Build the configuration.
at line 246
protected Configuration
configure(Configuration|null $config = null)
Build the signer, and the configuration unless one is given.
at line 271
protected Signer
getSigner()
Get the signer instance.
at line 347
protected Key
getKey(string $contents, string $passphrase = '')
Get the signing key instance.