PHP Classes

File: web/SSO/vendor/simplesamlphp/xmlseclibs/tests/getcipherdata.phpt

Recommend this page to a friend!
  Classes of william amed   Raptor 2   web/SSO/vendor/simplesamlphp/xmlseclibs/tests/getcipherdata.phpt   Download  
File: web/SSO/vendor/simplesamlphp/xmlseclibs/tests/getcipherdata.phpt
Role: Example script
Content type: text/plain
Description: Example script
Class: Raptor 2
Framework that takes routes from annotations
Author: By
Last change:
Date: 8 years ago
Size: 720 bytes
 

Contents

Class file image Download
--TEST--
Test the getCipherData() function.
--FILE--
<?php
require(dirname(__FILE__) . '/../xmlseclibs.php');

$doc = new DOMDocument();
$doc->load(dirname(__FILE__) . '/oaep_sha1-res.xml');


$objenc = new XMLSecEnc();
$encData = $objenc->locateEncryptedData($doc);
$objenc->setNode($encData);

$ciphervalue = $objenc->getCipherValue();
printf("Data CipherValue: %s\n", md5($ciphervalue));

$objKey = $objenc->locateKey();
$objKeyInfo = $objenc->locateKeyInfo($objKey);
$encryptedKey = $objKeyInfo->encryptedCtx;

$keyCV = $encryptedKey->getCipherValue();
printf("Key CipherValue: %s\n", md5($keyCV));

?>
--EXPECTF--
Data CipherValue: e3b188c5a139655d14d3f7a1e6477bc3
Key CipherValue: b36f81645cb068dd59d69c7ff96e835a