public function validate(XMLSecurityKey $key) : bool
    {
        if (count($this->validators) === 0) {
            return false;
        }

        $exceptions = [];

        foreach ($this->validators as $validator) {
            $function = $validator['Function'];
            $data = $validator['Data'];

            try {
                call_user_func($function, $data, $key);
                /* We were able to validate the message with this validator. */

                return true;
            } catch (\Exception $e) {
                $exceptions[] = $e;
            }
        }

        /* No validators were able to validate the message. */
        throw $exceptions[0];
    }
public function validate(XMLSecurityKey $key) : bool
    {
        if (count($this->validators) === 0) {
            return false;
        }

        $exceptions = [];

        foreach ($this->validators as $validator) {
            $function = $validator['Function'];
            $data = $validator['Data'];

            try {
                call_user_func($function, $data, $key);
                /* We were able to validate the message with this validator. */

                return true;
            } catch (\Exception $e) {
                $exceptions[] = $e;
            }
        }

        /* No validators were able to validate the message. */
        throw $exceptions[0];
    }
public function validate ( XMLSecurityKey $ key ) : bool { if ( count ( $ this -> validators ) === 0 ) { return false ; } $ exceptions = [ ] ; foreach ( $ this -> validators as $ validator ) { $ function = $ validator [ 'Function' ] ; $ data = $ validator [ 'Data' ] ; try { call_user_func ( $ function , $ data , $ key ) ; /* We were able to validate the message with this validator. */ return true ; } catch ( \ Exception $ e ) { $ exceptions [ ] = $ e ; } } /* No validators were able to validate the message. */ throw $ exceptions [ 0 ] ; }
Validate this message against a public key.

true is returned on success, false is returned if we don't have any
signature we can validate. An exception is thrown if the signature
validation fails.

@param XMLSecurityKey $key The key we should check against
@throws \Exception
@return bool true on success, false when we don't have a signature
Validate this message against a public key .