PHP Classes

File: web/SSO/vendor/simplesamlphp/xmlseclibs/tests/retrievalmethod-findkey.phpt

Recommend this page to a friend!
  Classes of william amed   Raptor 2   web/SSO/vendor/simplesamlphp/xmlseclibs/tests/retrievalmethod-findkey.phpt   Download  
File: web/SSO/vendor/simplesamlphp/xmlseclibs/tests/retrievalmethod-findkey.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: 652 bytes
 

Contents

Class file image Download
--TEST--
Test for ds:RetrievalMethod.
--FILE--
<?php
require(dirname(__FILE__) . '/../xmlseclibs.php');

$doc = new DOMDocument();
$doc->load(dirname(__FILE__) . "/retrievalmethod-findkey.xml");

$objenc = new XMLSecEnc();
$encData = $objenc->locateEncryptedData($doc);
if (!
$encData) {
    throw new
Exception("Cannot locate Encrypted Data");
}
$objenc->setNode($encData);
$objenc->type = $encData->getAttribute("Type");
$objKey = $objenc->locateKey();

$objKeyInfo = $objenc->locateKeyInfo($objKey);

if (!
$objKeyInfo->isEncrypted) {
    throw new
Exception('Expected $objKeyInfo to refer to an encrypted key by now.');
}

echo
"OK\n";

?>
--EXPECTF--
OK