Login   Register  
PHP Classes
elePHPant
Icontem

File: verify.example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Alexander Kalendarev  >  XML Security  >  verify.example.php  >  Download  
File: verify.example.php
Role: Example script
Content type: text/plain
Description: example of verify design xml document
Class: XML Security
Encrypt and decrypt XML documents
Author: By
Last change: edit exchange
Date: 2006-04-18 00:27
Size: 725 bytes
 

Contents

Class file image Download
<?
include "xmlsec.class.php";

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

  
$xmlstr fread($ffilesize("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);
 
?>