Login   Register  
PHP Classes
elePHPant
Icontem

File: dsig.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  >  dsig.example.php  >  Download  
File: dsig.example.php
Role: Example script
Content type: text/plain
Description: example of using design xml document
Class: XML Security
Encrypt and decrypt XML documents
Author: By
Last change:
Date: 2006-04-18 00:13
Size: 631 bytes
 

Contents

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


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

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



?>