summaryrefslogtreecommitdiffstats
path: root/lib/SAML2/XML/mdrpi
diff options
context:
space:
mode:
Diffstat (limited to 'lib/SAML2/XML/mdrpi')
-rw-r--r--lib/SAML2/XML/mdrpi/Common.php14
-rw-r--r--lib/SAML2/XML/mdrpi/PublicationInfo.php102
-rw-r--r--lib/SAML2/XML/mdrpi/RegistrationInfo.php86
3 files changed, 0 insertions, 202 deletions
diff --git a/lib/SAML2/XML/mdrpi/Common.php b/lib/SAML2/XML/mdrpi/Common.php
deleted file mode 100644
index f6a4dc3..0000000
--- a/lib/SAML2/XML/mdrpi/Common.php
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-
-/**
- * Common definitions for the mdrpi metadata extension.
- *
- * @link: http://docs.oasis-open.org/security/saml/Post2.0/saml-metadata-rpi/v1.0/saml-metadata-rpi-v1.0.pdf
- * @package simpleSAMLphp
- * @version $Id$
- */
-class SAML2_XML_mdrpi_Common {
-
- const NS_MDRPI = 'urn:oasis:names:tc:SAML:metadata:rpi';
-
-}
diff --git a/lib/SAML2/XML/mdrpi/PublicationInfo.php b/lib/SAML2/XML/mdrpi/PublicationInfo.php
deleted file mode 100644
index bf6bff8..0000000
--- a/lib/SAML2/XML/mdrpi/PublicationInfo.php
+++ /dev/null
@@ -1,102 +0,0 @@
-<?php
-
-/**
- * Class for handling the mdrpi:PublicationInfo element.
- *
- * @link: http://docs.oasis-open.org/security/saml/Post2.0/saml-metadata-rpi/v1.0/saml-metadata-rpi-v1.0.pdf
- * @package simpleSAMLphp
- * @version $Id$
- */
-class SAML2_XML_mdrpi_PublicationInfo {
-
- /**
- * The identifier of the metadata publisher.
- *
- * @var string
- */
- public $publisher;
-
- /**
- * The creation timestamp for the metadata, as a UNIX timestamp.
- *
- * @var int|NULL
- */
- public $creationInstant;
-
- /**
- * Identifier for this metadata publication.
- *
- * @var string|NULL
- */
- public $publicationId;
-
- /**
- * Link to usage policy for this metadata.
- *
- * This is an associative array with language=>URL.
- *
- * @var array
- */
- public $UsagePolicy = array();
-
-
- /**
- * Create/parse a mdrpi:PublicationInfo element.
- *
- * @param DOMElement|NULL $xml The XML element we should load.
- */
- public function __construct(DOMElement $xml = NULL) {
-
- if ($xml === NULL) {
- return;
- }
-
- if (!$xml->hasAttribute('publisher')) {
- throw new Exception('Missing required attribute "publisher" in mdrpi:PublicationInfo element.');
- }
- $this->publisher = $xml->getAttribute('publisher');
-
- if ($xml->hasAttribute('creationInstant')) {
- $this->creationInstant = SimpleSAML_Utilities::parseSAML2Time($xml->getAttribute('creationInstant'));
- }
-
- if ($xml->hasAttribute('publicationId')) {
- $this->publicationId = $xml->getAttribute('publicationId');
- }
-
- $this->UsagePolicy = SAML2_Utils::extractLocalizedStrings($xml, SAML2_XML_mdrpi_Common::NS_MDRPI, 'UsagePolicy');
- }
-
-
- /**
- * Convert this element to XML.
- *
- * @param DOMElement $parent The element we should append to.
- */
- public function toXML(DOMElement $parent) {
- assert('is_string($this->publisher)');
- assert('is_int($this->creationInstant) || is_null($this->creationInstant)');
- assert('is_string($this->publicationId) || is_null($this->publicationId)');
- assert('is_array($this->UsagePolicy)');
-
- $doc = $parent->ownerDocument;
-
- $e = $doc->createElementNS(SAML2_XML_mdrpi_Common::NS_MDRPI, 'mdrpi:PublicationInfo');
- $parent->appendChild($e);
-
- $e->setAttribute('publisher', $this->publisher);
-
- if ($this->creationInstant !== NULL) {
- $e->setAttribute('creationInstant', gmdate('Y-m-d\TH:i:s\Z', $this->creationInstant));
- }
-
- if ($this->publicationId !== NULL) {
- $e->setAttribute('publicationId', $this->publicationId);
- }
-
- SAML2_Utils::addStrings($e, SAML2_XML_mdrpi_Common::NS_MDRPI, 'mdrpi:UsagePolicy', TRUE, $this->UsagePolicy);
-
- return $e;
- }
-
-}
diff --git a/lib/SAML2/XML/mdrpi/RegistrationInfo.php b/lib/SAML2/XML/mdrpi/RegistrationInfo.php
deleted file mode 100644
index 4bb334a..0000000
--- a/lib/SAML2/XML/mdrpi/RegistrationInfo.php
+++ /dev/null
@@ -1,86 +0,0 @@
-<?php
-
-/**
- * Class for handling the mdrpi:RegistrationInfo element.
- *
- * @link: http://docs.oasis-open.org/security/saml/Post2.0/saml-metadata-rpi/v1.0/saml-metadata-rpi-v1.0.pdf
- * @package simpleSAMLphp
- * @version $Id$
- */
-class SAML2_XML_mdrpi_RegistrationInfo {
-
- /**
- * The identifier of the metadata registration authority.
- *
- * @var string
- */
- public $registrationAuthority;
-
- /**
- * The registration timestamp for the metadata, as a UNIX timestamp.
- *
- * @var int|NULL
- */
- public $registrationInstant;
-
- /**
- * Link to registration policy for this metadata.
- *
- * This is an associative array with language=>URL.
- *
- * @var array
- */
- public $RegistrationPolicy = array();
-
-
- /**
- * Create/parse a mdrpi:RegistrationInfo element.
- *
- * @param DOMElement|NULL $xml The XML element we should load.
- */
- public function __construct(DOMElement $xml = NULL) {
-
- if ($xml === NULL) {
- return;
- }
-
- if (!$xml->hasAttribute('registrationAuthority')) {
- throw new Exception('Missing required attribute "registrationAuthority" in mdrpi:RegistrationInfo element.');
- }
- $this->registrationAuthority = $xml->getAttribute('registrationAuthority');
-
- if ($xml->hasAttribute('registrationInstant')) {
- $this->registrationInstant = SimpleSAML_Utilities::parseSAML2Time($xml->getAttribute('registrationInstant'));
- }
-
- $this->RegistrationPolicy = SAML2_Utils::extractLocalizedStrings($xml, SAML2_XML_mdrpi_Common::NS_MDRPI, 'RegistrationPolicy');
- }
-
-
- /**
- * Convert this element to XML.
- *
- * @param DOMElement $parent The element we should append to.
- */
- public function toXML(DOMElement $parent) {
- assert('is_string($this->registrationAuthority)');
- assert('is_int($this->registrationInstant) || is_null($this->registrationInstant)');
- assert('is_array($this->RegistrationPolicy)');
-
- $doc = $parent->ownerDocument;
-
- $e = $doc->createElementNS(SAML2_XML_mdrpi_Common::NS_MDRPI, 'mdrpi:RegistrationInfo');
- $parent->appendChild($e);
-
- $e->setAttribute('registrationAuthority', $this->registrationAuthority);
-
- if ($this->registrationInstant !== NULL) {
- $e->setAttribute('registrationInstant', gmdate('Y-m-d\TH:i:s\Z', $this->registrationInstant));
- }
-
- SAML2_Utils::addStrings($e, SAML2_XML_mdrpi_Common::NS_MDRPI, 'mdrpi:RegistrationPolicy', TRUE, $this->RegistrationPolicy);
-
- return $e;
- }
-
-}