diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/InfoCard/Xml/KeyInfo/Default.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/InfoCard/Xml/KeyInfo/Default.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,64 @@ + block which doesn't provide a namespace + * In this context, it is assumed to mean that it is the type of KeyInfo block which + * contains the SecurityTokenReference + * + * @category Zend + * @package Zend_InfoCard + * @subpackage Zend_InfoCard_Xml + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_InfoCard_Xml_KeyInfo_Default extends Zend_InfoCard_Xml_KeyInfo_Abstract +{ + /** + * Returns the object representation of the SecurityTokenReference block + * + * @throws Zend_InfoCard_Xml_Exception + * @return Zend_InfoCard_Xml_SecurityTokenReference + */ + public function getSecurityTokenReference() + { + $this->registerXPathNamespace('o', 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'); + + list($sectokenref) = $this->xpath('//o:SecurityTokenReference'); + + if(!($sectokenref instanceof Zend_InfoCard_Xml_Element)) { + throw new Zend_InfoCard_Xml_Exception('Could not locate the Security Token Reference'); + } + + return Zend_InfoCard_Xml_SecurityTokenReference::getInstance($sectokenref); + } +}