ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SAML2\XML\saml\SubjectConfirmation Class Reference
+ Collaboration diagram for SAML2\XML\saml\SubjectConfirmation:

Public Member Functions

 __construct (\DOMElement $xml=null)
 Initialize (and parse? a SubjectConfirmation element. More...
 
 toXML (\DOMElement $parent)
 Convert this element to XML. More...
 

Data Fields

 $Method
 
 $NameID
 
 $SubjectConfirmationData
 

Detailed Description

Definition at line 13 of file SubjectConfirmation.php.

Constructor & Destructor Documentation

◆ __construct()

SAML2\XML\saml\SubjectConfirmation::__construct ( \DOMElement  $xml = null)

Initialize (and parse? a SubjectConfirmation element.

Parameters
\DOMElement | null$xmlThe XML element we should load.
Exceptions

Definition at line 42 of file SubjectConfirmation.php.

References $xml, Method, SubjectConfirmationData, and SAML2\Utils\xpQuery().

43  {
44  if ($xml === null) {
45  return;
46  }
47 
48  if (!$xml->hasAttribute('Method')) {
49  throw new \Exception('SubjectConfirmation element without Method attribute.');
50  }
51  $this->Method = $xml->getAttribute('Method');
52 
53  $nid = Utils::xpQuery($xml, './saml_assertion:NameID');
54  if (count($nid) > 1) {
55  throw new \Exception('More than one NameID in a SubjectConfirmation element.');
56  } elseif (!empty($nid)) {
57  $this->NameID = new NameID($nid[0]);
58  }
59 
60  $scd = Utils::xpQuery($xml, './saml_assertion:SubjectConfirmationData');
61  if (count($scd) > 1) {
62  throw new \Exception('More than one SubjectConfirmationData child in a SubjectConfirmation element.');
63  } elseif (!empty($scd)) {
65  }
66  }
$sc SubjectConfirmationData
$xml
Definition: metadata.php:240
$sc Method
static xpQuery(\DOMNode $node, $query)
Do an XPath query on an XML node.
Definition: Utils.php:191
+ Here is the call graph for this function:

Member Function Documentation

◆ toXML()

SAML2\XML\saml\SubjectConfirmation::toXML ( \DOMElement  $parent)

Convert this element to XML.

Parameters
\DOMElement$parentThe parent element we should append this element to.
Returns
This element, as XML.

Definition at line 74 of file SubjectConfirmation.php.

References Method, and SAML2\Constants\NS_SAML.

75  {
76  assert(is_string($this->Method));
77  assert(is_null($this->NameID) || $this->NameID instanceof NameID);
78  assert(is_null($this->SubjectConfirmationData) || $this->SubjectConfirmationData instanceof SubjectConfirmationData);
79 
80  $e = $parent->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:SubjectConfirmation');
81  $parent->appendChild($e);
82 
83  $e->setAttribute('Method', $this->Method);
84 
85  if (isset($this->NameID)) {
86  $this->NameID->toXML($e);
87  }
88  if (isset($this->SubjectConfirmationData)) {
89  $this->SubjectConfirmationData->toXML($e);
90  }
91 
92  return $e;
93  }
$sc SubjectConfirmationData
$sc Method
const NS_SAML
The namespace for the SAML 2 assertions.
Definition: Constants.php:220

Field Documentation

◆ $Method

SAML2\XML\saml\SubjectConfirmation::$Method

Definition at line 20 of file SubjectConfirmation.php.

◆ $NameID

SAML2\XML\saml\SubjectConfirmation::$NameID

Definition at line 27 of file SubjectConfirmation.php.

◆ $SubjectConfirmationData

SAML2\XML\saml\SubjectConfirmation::$SubjectConfirmationData

Definition at line 34 of file SubjectConfirmation.php.


The documentation for this class was generated from the following file: