public function verify()
	{
		if (is_null($this->publicKey))
		{
			trigger_error('Cannot verify XML digital signature without public key', E_USER_WARNING);
			return false;
		}
		
		// find the SignedInfo element which was signed
		$signedInfo = $this->doc->getElementsByTagName($this->nodeNsPrefix . 'SignedInfo')->item(0);
		if (is_null($signedInfo))
		{
			throw new \UnexpectedValueException('Unable to locate the SignedInfo node');
		}
		
		// canonicalize the SignedInfo element for signature checking
		$c14nSignedInfo = $this->canonicalize($signedInfo);

		// find the signature value to verify
		$signatureValue = $this->doc->getElementsByTagName($this->nodeNsPrefix . 'SignatureValue')->item(0);
		if (is_null($signatureValue))
		{
			throw new \UnexpectedValueException('Unable to locate the SignatureValue node');
		}
		
		$signature = base64_decode($signatureValue->nodeValue);	
		
		return 1 === openssl_verify($c14nSignedInfo, $signature, $this->publicKey, $this->openSSLAlgoMapping[$this->digestMethod]);
	}
public function verify()
	{
		if (is_null($this->publicKey))
		{
			trigger_error('Cannot verify XML digital signature without public key', E_USER_WARNING);
			return false;
		}
		
		// find the SignedInfo element which was signed
		$signedInfo = $this->doc->getElementsByTagName($this->nodeNsPrefix . 'SignedInfo')->item(0);
		if (is_null($signedInfo))
		{
			throw new \UnexpectedValueException('Unable to locate the SignedInfo node');
		}
		
		// canonicalize the SignedInfo element for signature checking
		$c14nSignedInfo = $this->canonicalize($signedInfo);

		// find the signature value to verify
		$signatureValue = $this->doc->getElementsByTagName($this->nodeNsPrefix . 'SignatureValue')->item(0);
		if (is_null($signatureValue))
		{
			throw new \UnexpectedValueException('Unable to locate the SignatureValue node');
		}
		
		$signature = base64_decode($signatureValue->nodeValue);	
		
		return 1 === openssl_verify($c14nSignedInfo, $signature, $this->publicKey, $this->openSSLAlgoMapping[$this->digestMethod]);
	}
public function verify ( ) { if ( is_null ( $ this -> publicKey ) ) { trigger_error ( 'Cannot verify XML digital signature without public key' , E_USER_WARNING ) ; return false ; } // find the SignedInfo element which was signed $ signedInfo = $ this -> doc -> getElementsByTagName ( $ this -> nodeNsPrefix . 'SignedInfo' ) -> item ( 0 ) ; if ( is_null ( $ signedInfo ) ) { throw new \ UnexpectedValueException ( 'Unable to locate the SignedInfo node' ) ; } // canonicalize the SignedInfo element for signature checking $ c14nSignedInfo = $ this -> canonicalize ( $ signedInfo ) ; // find the signature value to verify $ signatureValue = $ this -> doc -> getElementsByTagName ( $ this -> nodeNsPrefix . 'SignatureValue' ) -> item ( 0 ) ; if ( is_null ( $ signatureValue ) ) { throw new \ UnexpectedValueException ( 'Unable to locate the SignatureValue node' ) ; } $ signature = base64_decode ( $ signatureValue -> nodeValue ) ; return 1 === openssl_verify ( $ c14nSignedInfo , $ signature , $ this -> publicKey , $ this -> openSSLAlgoMapping [ $ this -> digestMethod ] ) ; }
Verifies the XML digital signature

@throws	\UnexpectedValueException	If the XML tree is not intact
@return	bool						Verification result
Verifies the XML digital signature