verifySignature() public method

Verifies the data (string) against the given signature using the extension assigned to the type in the constructor.
public verifySignature ( string $data, string $signature ) : boolean | integer
$data string
$signature string
return boolean | integer
Example #1
0
 /**
  * @param XMLSecurityKey $objKey
  * @return bool|int
  * @throws Exception
  */
 public function verify($objKey)
 {
     $doc = $this->sigNode->ownerDocument;
     $xpath = new DOMXPath($doc);
     $xpath->registerNamespace('secdsig', self::XMLDSIGNS);
     $query = "string(./secdsig:SignatureValue)";
     $sigValue = $xpath->evaluate($query, $this->sigNode);
     if (empty($sigValue)) {
         throw new Exception("Unable to locate SignatureValue");
     }
     return $objKey->verifySignature($this->signedInfo, base64_decode($sigValue));
 }