Provider
abstract class Provider
Constants
| ALGO_HS256 |
|
| ALGO_HS384 |
|
| ALGO_HS512 |
|
| ALGO_RS256 |
|
| ALGO_RS384 |
|
| ALGO_RS512 |
|
| ALGO_ES256 |
|
| ALGO_ES384 |
|
| ALGO_ES512 |
|
Methods
Constructor.
Get the algorithm used to sign the token.
Get the secret used to sign the token.
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.
Hook fired after any of algo/secret/keys is mutated.
Details
at line 34
__construct(string $secret, string $algo, array $keys)
Constructor.
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.
at line 63
string
getAlgo()
Get the algorithm used to sign the token.
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.
at line 88
string
getSecret()
Get the secret used to sign the token.
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.
at line 113
array
getKeys()
Get the array of keys used to sign tokens with an asymmetric algorithm.
at line 121
string|null
getPublicKey()
Get the public key used to sign tokens with an asymmetric algorithm.
at line 129
string|null
getPrivateKey()
Get the private key used to sign tokens with an asymmetric algorithm.
at line 138
string|null
getPassphrase()
Get the passphrase used to sign tokens with an asymmetric algorithm.
at line 146
protected mixed
getSigningKey()
Get the key used to sign the tokens.
at line 154
protected mixed
getVerificationKey()
Get the key used to verify the tokens.
at line 162
abstract protected bool
isAsymmetric()
Determine if the algorithm is asymmetric, and thus requires a public/private key combo.
at line 170
protected void
onConfigurationChanged()
Hook fired after any of algo/secret/keys is mutated.
Subclasses that cache derived state (signers, configuration objects) override this to invalidate it so the new values take effect on next use.