public static function validateSignature(array $data, XMLSecurityKey $key) : void
    {
        Assert::keyExists($data, "Query");
        Assert::keyExists($data, "SigAlg");
        Assert::keyExists($data, "Signature");

        $query = $data['Query'];
        $sigAlg = $data['SigAlg'];
        $signature = $data['Signature'];

        $signature = base64_decode($signature);

        if ($key->type !== XMLSecurityKey::RSA_SHA256) {
            throw new \Exception('Invalid key type for validating signature on query string.');
        }
        if ($key->type !== $sigAlg) {
            $key = Utils::castKey($key, $sigAlg);
        }

        if ($key->verifySignature($query, $signature) !== 1) {
            throw new \Exception('Unable to validate signature on query string.');
        }
    }
public static function validateSignature(array $data, XMLSecurityKey $key) : void
    {
        Assert::keyExists($data, "Query");
        Assert::keyExists($data, "SigAlg");
        Assert::keyExists($data, "Signature");

        $query = $data['Query'];
        $sigAlg = $data['SigAlg'];
        $signature = $data['Signature'];

        $signature = base64_decode($signature);

        if ($key->type !== XMLSecurityKey::RSA_SHA256) {
            throw new \Exception('Invalid key type for validating signature on query string.');
        }
        if ($key->type !== $sigAlg) {
            $key = Utils::castKey($key, $sigAlg);
        }

        if ($key->verifySignature($query, $signature) !== 1) {
            throw new \Exception('Unable to validate signature on query string.');
        }
    }
public static function validateSignature ( array $ data , XMLSecurityKey $ key ) : void { Assert :: keyExists ( $ data , "Query" ) ; Assert :: keyExists ( $ data , "SigAlg" ) ; Assert :: keyExists ( $ data , "Signature" ) ; $ query = $ data [ 'Query' ] ; $ sigAlg = $ data [ 'SigAlg' ] ; $ signature = $ data [ 'Signature' ] ; $ signature = base64_decode ( $ signature ) ; if ( $ key -> type !== XMLSecurityKey :: RSA_SHA256 ) { throw new \ Exception ( 'Invalid key type for validating signature on query string.' ) ; } if ( $ key -> type !== $ sigAlg ) { $ key = Utils :: castKey ( $ key , $ sigAlg ) ; } if ( $ key -> verifySignature ( $ query , $ signature ) !== 1 ) { throw new \ Exception ( 'Unable to validate signature on query string.' ) ; } }
Validate the signature on a HTTP-Redirect message.

Throws an exception if we are unable to validate the signature.

@param array          $data The data we need to validate the query string.
@param XMLSecurityKey $key  The key we should validate the query against.
@throws \Exception
@return void
Validate the signature on a HTTP - Redirect message .