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.
16
* @package Zend_InfoCard
17
* @subpackage Zend_InfoCard_Xml
18
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
19
* @license http://framework.zend.com/license/new-bsd New BSD License
20
* @version $Id: XmlEnc.php 9094 2008-03-30 18:36:55Z thomas $
24
* Zend_InfoCard_Xml_EncryptedData/Abstract.php
26
require_once 'Zend/InfoCard/Xml/EncryptedData/Abstract.php';
29
* An XmlEnc formatted EncryptedData XML block
32
* @package Zend_InfoCard
33
* @subpackage Zend_InfoCard_Xml
34
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
35
* @license http://framework.zend.com/license/new-bsd New BSD License
37
class Zend_InfoCard_Xml_EncryptedData_XmlEnc extends Zend_InfoCard_Xml_EncryptedData_Abstract
41
* Returns the Encrypted CipherValue block from the EncryptedData XML document
43
* @throws Zend_InfoCard_Xml_Exception
44
* @return string The value of the CipherValue block base64 encoded
46
public function getCipherValue()
48
$this->registerXPathNamespace('enc', 'http://www.w3.org/2001/04/xmlenc#');
50
list(,$cipherdata) = $this->xpath("//enc:CipherData");
52
if(!($cipherdata instanceof Zend_InfoCard_Xml_Element)) {
53
throw new Zend_InfoCard_Xml_Exception("Unable to find the enc:CipherData block");
56
list(,$ciphervalue) = $cipherdata->xpath("//enc:CipherValue");
58
if(!($ciphervalue instanceof Zend_InfoCard_Xml_Element)) {
59
throw new Zend_InfoCard_Xml_Exception("Unable to fidn the enc:CipherValue block");
62
return (string)$ciphervalue;