public function verifyPayLoad($payLoad, $sig, $algo = null)
    {
        $encryptedPayload = $this->encryptPayLoadBasedOnToken($payLoad, $algo);
        if (strcmp($sig, $encryptedPayload) == 0) {
            return true;
        } else {
            return false;
        }
    }
public function verifyPayLoad($payLoad, $sig, $algo = null)
    {
        $encryptedPayload = $this->encryptPayLoadBasedOnToken($payLoad, $algo);
        if (strcmp($sig, $encryptedPayload) == 0) {
            return true;
        } else {
            return false;
        }
    }
public function verifyPayLoad ( $ payLoad , $ sig , $ algo = null ) { $ encryptedPayload = $ this -> encryptPayLoadBasedOnToken ( $ payLoad , $ algo ) ; if ( strcmp ( $ sig , $ encryptedPayload ) == 0 ) { return true ; } else { return false ; } }
Using the token to encrypt payload and compare with sig

@param $payLoad
The payload to be verified
@param $sig
The signature retrieved from header
@param null $algo
The algo used to encrypt
@return bool
True if same false otherwise
Using the token to encrypt payload and compare with sig