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


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

  $xmlstr = fread($f, filesize("data.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' , "/home/akalend/temp");



 $res =  $xmlsec->sign( $doc,  XMLSEC_RSA_SHA1 );

//        die( $xmlsec->errorMsg );
if ( !$res  )
   die( $xmlsec->errorMsg  .'<br>'.$xmlsec->cmd);
 else
  header('Content-type: text/xml');

PRINT  $res;



?>
Return current item: XML Security