ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SAML2\XML\alg\SigningMethod Class Reference
+ Collaboration diagram for SAML2\XML\alg\SigningMethod:

Public Member Functions

 __construct (\DOMElement $xml=null)
 Create/parse an alg:SigningMethod element. More...
 
 toXML (\DOMElement $parent)
 Convert this element to XML. More...
 

Data Fields

 $Algorithm
 
 $MinKeySize
 
 $MaxKeySize
 

Detailed Description

Definition at line 12 of file SigningMethod.php.

Constructor & Destructor Documentation

◆ __construct()

SAML2\XML\alg\SigningMethod::__construct ( \DOMElement  $xml = null)

Create/parse an alg:SigningMethod element.

Parameters
\DOMElement | null$xmlThe XML element we should load or null to create a new one from scratch.
Exceptions

Definition at line 47 of file SigningMethod.php.

References $xml.

48  {
49  if ($xml === null) {
50  return;
51  }
52 
53  if (!$xml->hasAttribute('Algorithm')) {
54  throw new \Exception('Missing required attribute "Algorithm" in alg:SigningMethod element.');
55  }
56  $this->Algorithm = $xml->getAttribute('Algorithm');
57 
58  if ($xml->hasAttribute('MinKeySize')) {
59  $this->MinKeySize = intval($xml->getAttribute('MinKeySize'));
60  }
61 
62  if ($xml->hasAttribute('MaxKeySize')) {
63  $this->MaxKeySize = intval($xml->getAttribute('MaxKeySize'));
64  }
65  }

Member Function Documentation

◆ toXML()

SAML2\XML\alg\SigningMethod::toXML ( \DOMElement  $parent)

Convert this element to XML.

Parameters
\DOMElement$parentThe element we should append to.
Returns

Definition at line 74 of file SigningMethod.php.

References SAML2\XML\alg\Common\NS.

75  {
76  assert(is_string($this->Algorithm));
77  assert(is_int($this->MinKeySize) || is_null($this->MinKeySize));
78  assert(is_int($this->MaxKeySize) || is_null($this->MaxKeySize));
79 
80  $doc = $parent->ownerDocument;
81  $e = $doc->createElementNS(Common::NS, 'alg:SigningMethod');
82  $parent->appendChild($e);
83  $e->setAttribute('Algorithm', $this->Algorithm);
84 
85  if ($this->MinKeySize !== null) {
86  $e->setAttribute('MinKeySize', $this->MinKeySize);
87  }
88 
89  if ($this->MaxKeySize !== null) {
90  $e->setAttribute('MaxKeySize', $this->MaxKeySize);
91  }
92 
93  return $e;
94  }

Field Documentation

◆ $Algorithm

SAML2\XML\alg\SigningMethod::$Algorithm

Definition at line 19 of file SigningMethod.php.

◆ $MaxKeySize

SAML2\XML\alg\SigningMethod::$MaxKeySize

Definition at line 37 of file SigningMethod.php.

◆ $MinKeySize

SAML2\XML\alg\SigningMethod::$MinKeySize

Definition at line 28 of file SigningMethod.php.


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