web/lib/Zend/InfoCard/Xml/KeyInfo/Default.php
changeset 64 162c1de6545a
parent 19 1c2f13fd785c
child 68 ecaf28ffe26e
equal deleted inserted replaced
63:5b37998e522e 64:162c1de6545a
       
     1 <?php
       
     2 /**
       
     3  * Zend Framework
       
     4  *
       
     5  * LICENSE
       
     6  *
       
     7  * This source file is subject to the new BSD license that is bundled
       
     8  * with this package in the file LICENSE.txt.
       
     9  * It is also available through the world-wide-web at this URL:
       
    10  * http://framework.zend.com/license/new-bsd
       
    11  * If you did not receive a copy of the license and are unable to
       
    12  * obtain it through the world-wide-web, please send an email
       
    13  * to license@zend.com so we can send you a copy immediately.
       
    14  *
       
    15  * @category   Zend
       
    16  * @package    Zend_InfoCard
       
    17  * @subpackage Zend_InfoCard_Xml
       
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    20  * @version    $Id: Default.php 20096 2010-01-06 02:05:09Z bkarwin $
       
    21  */
       
    22 
       
    23 /**
       
    24  * Zend_InfoCard_Xml_KeyInfo_Abstract
       
    25  */
       
    26 require_once 'Zend/InfoCard/Xml/KeyInfo/Abstract.php';
       
    27 
       
    28 /**
       
    29  * Zend_InfoCard_Xml_SecurityTokenReference
       
    30  */
       
    31 require_once 'Zend/InfoCard/Xml/SecurityTokenReference.php';
       
    32 
       
    33 /**
       
    34  * An object representation of a XML <KeyInfo> block which doesn't provide a namespace
       
    35  * In this context, it is assumed to mean that it is the type of KeyInfo block which
       
    36  * contains the SecurityTokenReference
       
    37  *
       
    38  * @category   Zend
       
    39  * @package    Zend_InfoCard
       
    40  * @subpackage Zend_InfoCard_Xml
       
    41  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    42  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    43  */
       
    44 class Zend_InfoCard_Xml_KeyInfo_Default extends Zend_InfoCard_Xml_KeyInfo_Abstract
       
    45 {
       
    46     /**
       
    47      * Returns the object representation of the SecurityTokenReference block
       
    48      *
       
    49      * @throws Zend_InfoCard_Xml_Exception
       
    50      * @return Zend_InfoCard_Xml_SecurityTokenReference
       
    51      */
       
    52     public function getSecurityTokenReference()
       
    53     {
       
    54         $this->registerXPathNamespace('o', 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd');
       
    55 
       
    56         list($sectokenref) = $this->xpath('//o:SecurityTokenReference');
       
    57 
       
    58         if(!($sectokenref instanceof Zend_InfoCard_Xml_Element)) {
       
    59             throw new Zend_InfoCard_Xml_Exception('Could not locate the Security Token Reference');
       
    60         }
       
    61 
       
    62         return Zend_InfoCard_Xml_SecurityTokenReference::getInstance($sectokenref);
       
    63     }
       
    64 }