private function validateSignature(Request $request)
    {
        if (null === $request->request || !$request->request->validateSignature()) {
            return;
        }

        // validate cert url
        $this->validateCertUrl($request);

        // generate local cert path
        $localCertPath = sys_get_temp_dir().DIRECTORY_SEPARATOR.md5($request->signatureCertChainUrl).'.pem';

        // check if pem file is already downloaded to temp or download.
        $certData = $this->fetchCertData($request, $localCertPath);

        // openssl cert validation
        $this->verifyCert($request, $certData);

        // parse cert
        $certContent = $this->parseCertData($certData);

        // validate cert
        $this->validateCertContent($certContent, $localCertPath);
    }
private function validateSignature(Request $request)
    {
        if (null === $request->request || !$request->request->validateSignature()) {
            return;
        }

        // validate cert url
        $this->validateCertUrl($request);

        // generate local cert path
        $localCertPath = sys_get_temp_dir().DIRECTORY_SEPARATOR.md5($request->signatureCertChainUrl).'.pem';

        // check if pem file is already downloaded to temp or download.
        $certData = $this->fetchCertData($request, $localCertPath);

        // openssl cert validation
        $this->verifyCert($request, $certData);

        // parse cert
        $certContent = $this->parseCertData($certData);

        // validate cert
        $this->validateCertContent($certContent, $localCertPath);
    }
private function validateSignature ( Request $ request ) { if ( null === $ request -> request || ! $ request -> request -> validateSignature ( ) ) { return ; } // validate cert url $ this -> validateCertUrl ( $ request ) ; // generate local cert path $ localCertPath = sys_get_temp_dir ( ) . DIRECTORY_SEPARATOR . md5 ( $ request -> signatureCertChainUrl ) . '.pem' ; // check if pem file is already downloaded to temp or download. $ certData = $ this -> fetchCertData ( $ request , $ localCertPath ) ; // openssl cert validation $ this -> verifyCert ( $ request , $ certData ) ; // parse cert $ certContent = $ this -> parseCertData ( $ certData ) ; // validate cert $ this -> validateCertContent ( $ certContent , $ localCertPath ) ; }
Validate request signature. The steps for signature validation are described at developer page.

@see https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/developing-an-alexa-skill-as-a-web-service#checking-the-signature-of-the-request

@param Request $request

@throws OutdatedCertExceptionException
@throws RequestInvalidSignatureException
Validate request signature . The steps for signature validation are described at developer page .