JWSVerifier
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- JWSVerifier constructor.
- getSignatureAlgorithmManager() : AlgorithmManager
- Returns the algorithm manager associated to the JWSVerifier.
- verifyWithKey() : bool
- This method will try to verify the JWS object using the given key and for the given signature.
- verifyWithKeySet() : bool
- This method will try to verify the JWS object using the given key set and for the given signature.
- checkPayload() : void
- getAlgorithm() : MacAlgorithm|SignatureAlgorithm
- getInputToVerify() : string
- isPayloadEmpty() : bool
- verifySignature() : bool
Properties
$signatureAlgorithmManager
private
AlgorithmManager
$signatureAlgorithmManager
Methods
__construct()
JWSVerifier constructor.
public
__construct(AlgorithmManager $signatureAlgorithmManager) : mixed
Parameters
- $signatureAlgorithmManager : AlgorithmManager
getSignatureAlgorithmManager()
Returns the algorithm manager associated to the JWSVerifier.
public
getSignatureAlgorithmManager() : AlgorithmManager
Return values
AlgorithmManagerverifyWithKey()
This method will try to verify the JWS object using the given key and for the given signature.
public
verifyWithKey(JWS $jws, JWK $jwk, int $signature[, string|null $detachedPayload = null ]) : bool
It returns true if the signature is verified, otherwise false.
Parameters
Return values
bool —true if the verification of the signature succeeded, else false
verifyWithKeySet()
This method will try to verify the JWS object using the given key set and for the given signature.
public
verifyWithKeySet(JWS $jws, JWKSet $jwkset, int $signatureIndex[, null|string $detachedPayload = null ][, JWK &$jwk = null ]) : bool
It returns true if the signature is verified, otherwise false.
Parameters
- $jws : JWS
-
A JWS object
- $jwkset : JWKSet
-
The signature will be verified using keys in the key set
- $signatureIndex : int
- $detachedPayload : null|string = null
-
If not null, the value must be the detached payload encoded in Base64 URL safe. If the input contains a payload, throws an exception.
- $jwk : JWK = null
-
The key used to verify the signature in case of success
Tags
Return values
bool —true if the verification of the signature succeeded, else false
checkPayload()
private
checkPayload(JWS $jws[, string|null $detachedPayload = null ]) : void
Parameters
- $jws : JWS
- $detachedPayload : string|null = null
Tags
getAlgorithm()
private
getAlgorithm(Signature $signature) : MacAlgorithm|SignatureAlgorithm
Parameters
- $signature : Signature
Tags
Return values
MacAlgorithm|SignatureAlgorithmgetInputToVerify()
private
getInputToVerify(JWS $jws, Signature $signature, string|null $detachedPayload) : string
Parameters
Return values
stringisPayloadEmpty()
private
isPayloadEmpty(string|null $payload) : bool
Parameters
- $payload : string|null
Return values
boolverifySignature()
private
verifySignature(JWS $jws, JWKSet $jwkset, Signature $signature[, string|null $detachedPayload = null ][, JWK &$successJwk = null ]) : bool
Parameters
- $jws : JWS
- $jwkset : JWKSet
- $signature : Signature
- $detachedPayload : string|null = null
- $successJwk : JWK = null