PayWithAmazon\IpnHandler::constructAndVerifySignature PHP Method

constructAndVerifySignature() private method

* Verify that the signature is correct for the given data and public key
    private function constructAndVerifySignature()
    {
        $signature = base64_decode($this->getMandatoryField("Signature"));
        $certificatePath = $this->getMandatoryField("SigningCertURL");
        $this->validateUrl($certificatePath);
        $this->certificate = $this->getCertificate($certificatePath);
        $result = $this->verifySignatureIsCorrectFromCertificate($signature);
        if (!$result) {
            throw new \Exception("Unable to match signature from remote server: signature of " . $this->getCertificate($certificatePath) . " , SigningCertURL of " . $this->getMandatoryField("SigningCertURL") . " , SignatureOf " . $this->getMandatoryField("Signature"));
        }
    }