Location: PHPKode > scripts > XML Security > xml-security/verify.example.php
<?
include "xmlsec.class.php";

  $f =  fopen( "dsig.xml" , 'r') ;
  if ( !$f ){
     echo 'Error open file ';
     exit;
  }

  $xmlstr = fread($f, filesize("dsig.xml"));
  fclose($f);

  $doc = domxml_open_mem( $xmlstr );

 if ( !$doc )
  {
      echo "Error while parsing the input xml document\n";
      exit;
  }

  $xmlsec = new xmlsec( 'keys.xml' ,  	// keys file
  "/home/akalend/temp", 				// temp writeable directory if undefined in $TMPDIIR in ENV
   true);							// false for debugging - save temp files ( define is true ) 
 
 $res =  $xmlsec->verify( $doc );

  
 if ( $res  )
   print 'the sign verify';
   else 
   die( 'msg: '.$xmlsec->errorMsg .'<br> cmd:'.$xmlsec->cmd);
 
?>
Return current item: XML Security