Jelajahi Sumber

Merge branch 'hotfix/222'

Close #222
Matthew Weier O'Phinney 12 tahun lalu
induk
melakukan
b5cea5c81c
74 mengubah file dengan 2 tambahan dan 6204 penghapusan
  1. 2 0
      README.md
  2. 0 399
      documentation/manual/de/module_specs/Zend_InfoCard-Basics.xml
  3. 0 5
      documentation/manual/en/manual-print1.xml.in
  4. 0 9
      documentation/manual/en/manual.xml.in
  5. 0 392
      documentation/manual/en/module_specs/Zend_InfoCard-Basics.xml
  6. 0 25
      documentation/manual/en/ref/requirements-dependencies-table.xml
  7. 0 12
      documentation/manual/en/ref/requirements-zendcomponents-table.xml
  8. 0 22
      documentation/manual/es/ref/requirements-dependencies-table.xml
  9. 0 11
      documentation/manual/es/ref/requirements-zendcomponents-table.xml
  10. 0 13
      documentation/manual/he/ref/requirements.xml
  11. 0 25
      documentation/manual/hu/ref/requirements-dependencies-table.xml
  12. 0 12
      documentation/manual/hu/ref/requirements-zendcomponents-table.xml
  13. 0 15
      documentation/manual/id/ref/requirements.xml
  14. 0 404
      documentation/manual/ja/module_specs/Zend_InfoCard-Basics.xml
  15. 0 15
      documentation/manual/pl/ref/requirements.xml
  16. 0 497
      library/Zend/InfoCard.php
  17. 0 79
      library/Zend/InfoCard/Adapter/Default.php
  18. 0 37
      library/Zend/InfoCard/Adapter/Exception.php
  19. 0 64
      library/Zend/InfoCard/Adapter/Interface.php
  20. 0 99
      library/Zend/InfoCard/Cipher.php
  21. 0 38
      library/Zend/InfoCard/Cipher/Exception.php
  22. 0 88
      library/Zend/InfoCard/Cipher/Pki/Adapter/Abstract.php
  23. 0 120
      library/Zend/InfoCard/Cipher/Pki/Adapter/Rsa.php
  24. 0 33
      library/Zend/InfoCard/Cipher/Pki/Interface.php
  25. 0 50
      library/Zend/InfoCard/Cipher/Pki/Rsa/Interface.php
  26. 0 38
      library/Zend/InfoCard/Cipher/Symmetric/Adapter/Abstract.php
  27. 0 40
      library/Zend/InfoCard/Cipher/Symmetric/Adapter/Aes128cbc.php
  28. 0 111
      library/Zend/InfoCard/Cipher/Symmetric/Adapter/Aes256cbc.php
  29. 0 38
      library/Zend/InfoCard/Cipher/Symmetric/Aes128cbc/Interface.php
  30. 0 33
      library/Zend/InfoCard/Cipher/Symmetric/Aes256cbc/Interface.php
  31. 0 32
      library/Zend/InfoCard/Cipher/Symmetric/Interface.php
  32. 0 307
      library/Zend/InfoCard/Claims.php
  33. 0 43
      library/Zend/InfoCard/Exception.php
  34. 0 88
      library/Zend/InfoCard/Xml/Assertion.php
  35. 0 69
      library/Zend/InfoCard/Xml/Assertion/Interface.php
  36. 0 284
      library/Zend/InfoCard/Xml/Assertion/Saml.php
  37. 0 107
      library/Zend/InfoCard/Xml/Element.php
  38. 0 44
      library/Zend/InfoCard/Xml/Element/Interface.php
  39. 0 75
      library/Zend/InfoCard/Xml/EncryptedData.php
  40. 0 92
      library/Zend/InfoCard/Xml/EncryptedData/Abstract.php
  41. 0 64
      library/Zend/InfoCard/Xml/EncryptedData/XmlEnc.php
  42. 0 174
      library/Zend/InfoCard/Xml/EncryptedKey.php
  43. 0 37
      library/Zend/InfoCard/Xml/Exception.php
  44. 0 90
      library/Zend/InfoCard/Xml/KeyInfo.php
  45. 0 37
      library/Zend/InfoCard/Xml/KeyInfo/Abstract.php
  46. 0 64
      library/Zend/InfoCard/Xml/KeyInfo/Default.php
  47. 0 38
      library/Zend/InfoCard/Xml/KeyInfo/Interface.php
  48. 0 76
      library/Zend/InfoCard/Xml/KeyInfo/XmlDSig.php
  49. 0 327
      library/Zend/InfoCard/Xml/Security.php
  50. 0 37
      library/Zend/InfoCard/Xml/Security/Exception.php
  51. 0 116
      library/Zend/InfoCard/Xml/Security/Transform.php
  52. 0 60
      library/Zend/InfoCard/Xml/Security/Transform/EnvelopedSignature.php
  53. 0 37
      library/Zend/InfoCard/Xml/Security/Transform/Exception.php
  54. 0 43
      library/Zend/InfoCard/Xml/Security/Transform/Interface.php
  55. 0 59
      library/Zend/InfoCard/Xml/Security/Transform/XmlExcC14N.php
  56. 0 173
      library/Zend/InfoCard/Xml/SecurityTokenReference.php
  57. 0 2
      tests/Zend/AllTests.php
  58. 0 64
      tests/Zend/InfoCard/AllTests.php
  59. 0 108
      tests/Zend/InfoCard/AssertionTest.php
  60. 0 109
      tests/Zend/InfoCard/CipherTest.php
  61. 0 320
      tests/Zend/InfoCard/ProcessTest.php
  62. 0 92
      tests/Zend/InfoCard/XmlParsingTest.php
  63. 0 15
      tests/Zend/InfoCard/_files/encryptedkey.xml
  64. 0 15
      tests/Zend/InfoCard/_files/encryptedkey_bad_block.xml
  65. 0 15
      tests/Zend/InfoCard/_files/encryptedkey_missing_enc_algo.xml
  66. 0 12
      tests/Zend/InfoCard/_files/encryptedkey_missing_encryptionmethod.xml
  67. 0 22
      tests/Zend/InfoCard/_files/encryptedtoken.xml
  68. 0 22
      tests/Zend/InfoCard/_files/encryptedtoken2.xml
  69. 0 22
      tests/Zend/InfoCard/_files/encryptedtoken_bad_type.xml
  70. 0 5
      tests/Zend/InfoCard/_files/security_token_bad_keyref.xml
  71. 0 0
      tests/Zend/InfoCard/_files/signedToken.xml
  72. 0 0
      tests/Zend/InfoCard/_files/signedToken_bad_type.xml
  73. 0 51
      tests/Zend/InfoCard/_files/ssl_private.cert
  74. 0 33
      tests/Zend/InfoCard/_files/ssl_pub.cert

+ 2 - 0
README.md

@@ -13,6 +13,8 @@ IMPORTANT FIXES FOR 1.12.4
 
 - [#221](https://github.com/zendframework/zf1/pull/221) removes the TinySrc view
   helper, as the TinySrc service no longer exists.
+- [#222](https://github.com/zendframework/zf1/pull/222) removes the InfoCard
+  component, as the CardSpace service no longer exists.
 
 IMPORTANT FIXES FOR 1.12.3
 --------------------------

+ 0 - 399
documentation/manual/de/module_specs/Zend_InfoCard-Basics.xml

@@ -1,399 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 24249 -->
-<!-- Reviewed: no -->
-<sect1 id="zend.infocard.basics">
-    <title>Einführung</title>
-
-    <para>
-        Die <classname>Zend_InfoCard</classname> Komponente implementiert die Unterstützung
-        vertrauender Forderungen für Informationskarten. Informationskarten werden für
-        Identitätsmanagement im Internet verwendet und zur Authentifikation von Benutzern auf
-        Webseiten. Die Webseiten bei denen sich die Benutzer im Endeffekt authentifizieren werden
-        <emphasis>vertrauende Seiten</emphasis> genannt.
-    </para>
-
-    <para>
-        Detailierte Informationen über Informationskarten und Ihre Wichtigkeit für Internet
-        Identitätsmetasysteme können im <ulink
-            url="http://www.identityblog.com/">IdentityBlog</ulink> gefunden werden.
-    </para>
-
-    <sect2 id="zend.infocard.basics.theory">
-        <title>Grundsätzliche Theorie der Verwendung</title>
-
-        <para>
-            <classname>Zend_InfoCard</classname> kann auf einem von zwei Wegen verwendet werden:
-            Entweder als Teil der größeren <classname>Zend_Auth</classname> Komponente über den
-            <classname>Zend_InfoCard</classname> Authentifikationsadapter order als eigenständige
-            Komponente. In beiden Fällen kann eine Informationskarte von einem Benutzer angefragt
-            werden durch Verwenden des folgenden <acronym>HTML</acronym> Blocks im eigenen
-            <acronym>HTML</acronym> Anmeldeformular:
-        </para>
-
-        <programlisting language="html"><![CDATA[
-<form action="http://example.com/server" method="POST">
-  <input type='image' src='/images/ic.png' align='center'
-        width='120px' style='cursor:pointer' />
-  <object type="application/x-informationCard"
-          name="xmlToken">
-   <param name="tokenType"
-         value="urn:oasis:names:tc:SAML:1.0:assertion" />
-   <param name="requiredClaims"
-         value="http://.../claims/privatepersonalidentifier
-         http://.../claims/givenname
-         http://.../claims/surname" />
- </object>
-</form>
-]]></programlisting>
-
-        <para>
-            Im obigen Beispiel wird das <property>requiredClaims</property>
-            <emphasis>&lt;param&gt;</emphasis> Tag verwendet um Teile von Informationen zu
-            identifizieren die als Forderung bekannt sind (z.B. der Vorname und Nachname einer
-            Person) welche eine Webseite (genannt "vertrauende Forderung) benötigt um einen Benutzer
-            authentifizieren zu können der eine Informationskarte verwendet. Zur Referenz, ist die
-            komplette <acronym>URI</acronym> (zum Beispiel die <code>givename</code> Anforderung)
-            wie folgt:
-            <filename>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname</filename>
-        </para>
-
-        <para>
-            Wenn das obige <acronym>HTML</acronym> durch einen Benutzer aktiviert wird (angeklickt),
-            zeigt der Browser ein Kartenauswahlprogramm an, welche Ihm nicht nur die
-            Informationskarten anzeigt die den Anforderungen der Seite entsprechen, sondern es auch
-            erlaubt welche Informationskarte verwendet werden soll wenn mehrere den Kriterien
-            entsprechen. Diese Informationskarte wird als <acronym>XML</acronym> Dokument zu der
-            spezifizierten POST <acronym>URL</acronym> übertragen und steht dann zur Bearbeitung der
-            <classname>Zend_InfoCard</classname> Komponente zur Verfügung.
-        </para>
-
-        <para>
-            Beachte das Informationskarten nur zu <acronym>SSL</acronym>-verschlüsselten
-            <acronym>URL</acronym>s <acronym>HTTP</acronym> <acronym>POST</acronym>et werden können.
-            Die Dokumentation des WebServers sollte konsultiert werden für Details zum Einrichten
-            einer <acronym>SSL</acronym> Verschlüsselung.
-        </para>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.auth">
-        <title>Verwendung als Teil von Zend_Auth</title>
-
-        <para>
-            Um diese Komponente als Teil des <classname>Zend_Auth</classname>
-            Authentifikationssystems zu verwenden, muß die angebotene
-            <classname>Zend_Auth_Adapter_InfoCard</classname> verwendet werden (in der standalone
-            Distribution von <classname>Zend_InfoCard</classname> nicht enthalten). Ein Beispiel der
-            Verwendung wird anbei gezeigt:
-        </para>
-
-        <programlisting language="php"><![CDATA[
-<?php
-if (isset($_POST['xmlToken'])) {
-
-    $adapter = new Zend_Auth_Adapter_InfoCard($_POST['xmlToken']);
-
-    $adapter->addCertificatePair('/usr/local/Zend/apache2/conf/server.key',
-                                 '/usr/local/Zend/apache2/conf/server.crt');
-
-    $auth = Zend_Auth::getInstance();
-
-    $result = $auth->authenticate($adapter);
-
-    switch ($result->getCode()) {
-        case Zend_Auth_Result::SUCCESS:
-            $claims = $result->getIdentity();
-            print "Angegebener Name: {$claims->givenname}<br />";
-            print "Vorname: {$claims->surname}<br />";
-            print "Email Adresse: {$claims->emailaddress}<br />";
-            print "PPI: {$claims->getCardID()}<br />";
-            break;
-        case Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID:
-            print "Die angegebenen Daten haben der Überprüfung "
-                . "nicht standgehalten";
-            break;
-        default:
-        case Zend_Auth_Result::FAILURE:
-            print "Bei der Bearbeitung der Angaben trat ein Fehler auf.";
-            break;
-    }
-
-    if (count($result->getMessages()) > 0) {
-        print "<pre>";
-        var_dump($result->getMessages());
-        print "</pre>";
-    }
-
-}
-
-?>
-<hr />
-<div id="login" style="font-family: arial; font-size: 2em;">
-<p>Einfache Anmeldungsdemo</p>
- <form method="post">
-  <input type="submit" value="Login" />
-   <object type="application/x-informationCard" name="xmlToken">
-    <param name="tokenType"
-          value="urn:oasis:names:tc:SAML:1.0:assertion" />
-    <param name="requiredClaims"
-          value="http://.../claims/givenname
-                 http://.../claims/surname
-                 http://.../claims/emailaddress
-                 http://.../claims/privatepersonalidentifier" />
-  </object>
- </form>
-</div>
-]]></programlisting>
-
-        <para>
-            Im obigen Beispiel wurde zuerst eine Instanz von
-            <classname>Zend_Auth_Adapter_InfoCard</classname> erstellt und die durch die
-            Kartenauswahl geschickten <acronym>XML</acronym> Daten an Ihn übergeben. Sobald die
-            Instanz erstellt wurde muß zumindest ein <acronym>SSL</acronym>
-            Zertifizieruntsschlüssel, ein Paar öffentlich/privat der vom Webserver verwendet wird,
-            übergeben werden der mit <acronym>HTTP</acronym> <acronym>POST</acronym> empfangen
-            wurde. Diese Dateien werden verwendet um das Ziel der Information das an den Server
-            geschickt wurde zu überprüfen und sind eine Notwendigkeit wenn Informationskarten
-            verwendet werden.
-        </para>
-
-        <para>
-            Sobald der Adapter konfiguriert wurde können die normalen Fähigkeiten von
-            <classname>Zend_Auth</classname> verwendet werden um das angegebene Token der
-            Informationskarte zu prüfen und den Benutzer, durch Betrachten der Identität die von der
-            <methodname>getIdentity()</methodname> Methode geboten wird, zu authentifizieren.
-        </para>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.standalone">
-        <title>Die Zend_InfoCard Komponente alleine verwenden</title>
-
-        <para>
-            Es ist auch möglich die <classname>Zend_InfoCard</classname> Komponente als
-            alleinstehende Komponente zu verwenden durch direkte Interaktion mit der
-            <classname>Zend_InfoCard</classname> Klasse. Die Verwendung der Zend_InfoCard Klasse ist
-            ähnlich der Verwendung durch die <classname>Zend_Auth</classname> Komponente. Ein
-            Beispiel dieser Verwendung wird anbei gezeigt:
-        </para>
-
-        <programlisting language="php"><![CDATA[
-<?php
-if (isset($_POST['xmlToken'])) {
-    $infocard = new Zend_InfoCard();
-    $infocard->addCertificatePair('/usr/local/Zend/apache2/conf/server.key',
-                                  '/usr/local/Zend/apache2/conf/server.crt');
-
-    $claims = $infocard->process($_POST['xmlToken']);
-
-    if($claims->isValid()) {
-        print "Angegebener Name: {$claims->givenname}<br />";
-        print "Vorname: {$claims->surname}<br />";
-        print "Email Adresse: {$claims->emailaddress}<br />";
-        print "PPI: {$claims->getCardID()}<br />";
-    } else {
-        print "Fehler bei der Prüfung der Identität: {$claims->getErrorMsg()}";
-    }
-}
-?>
-<hr />
-<div id="login" style="font-family: arial; font-size: 2em;">
-<p>Einfache Login Demo</p>
- <form method="post">
-  <input type="submit" value="Login" />
-   <object type="application/x-informationCard" name="xmlToken">
-    <param name="tokenType"
-          value="urn:oasis:names:tc:SAML:1.0:assertion" />
-    <param name="requiredClaims"
-          value="http://.../claims/givenname
-                 http://.../claims/surname
-                 http://.../claims/emailaddress
-                 http://.../claims/privatepersonalidentifier" />
-   </object>
- </form>
-</div>
-]]></programlisting>
-
-        <para>
-            Im obigen Beispiel wird die <classname>Zend_InfoCard</classname> Komponente unabhängig
-            verwendet um den vom Benutzer angebotenen Token zu überprüfen. Die auch mit
-            <classname>Zend_Auth_Adapter_InfoCard</classname>, wird zuerst eine Instanz von
-            <classname>Zend_InfoCard</classname> erstellt und dann ein oder mehrere
-            <acronym>SSL</acronym> Zertifikatschlüssel, ein Paar öffentlich/privat die vom Webserver
-            verwendet werden. Sobald sie konfiguriert ist kann die
-            <methodname>process()</methodname> Methode verwendet werden um die Informationskarte zu
-            bearbeiten und die Ergebnisse zurückzugeben.
-        </para>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.claims">
-        <title>Mit einem Forderungs Objekt arbeiten</title>
-
-        <para>
-            Egal ob die <classname>Zend_InfoCard</classname> Komponente als alleinstehende
-            Komponente oder als Teil von <classname>Zend_Auth</classname> über
-            <classname>Zend_Auth_Adapter_InfoCard</classname> verwendet wird, ist das endgültige
-            Ergebnis der Bearbeitung einer Informationskarte ein
-            <classname>Zend_InfoCard_Claims</classname> Objekt. Dieses Objekt enthält die Annahmen
-            (auch Forderungen genannt) die vom schickenden Benutzer gemacht wurden, basierend auf
-            den Daten die von der Webseite angefragt wurden als sich der Benutzer authentifiziert
-            hat. Wie im obigen Beispiel gezeigt, kann die Gültigkeit der Informationskarte
-            sichergestellt werden indem die <methodname>Zend_InfoCard_Claims::isValid()</methodname>
-            Methode aufgerufen wird. Forderungen ihrerseits können entweder empfangen werden indem
-            auf den gewünschten Identikator zugegriffen wird (z.B. <property>givenname</property>)
-            als eine Eigenschaft des Objekts oder durch die <methodname>getClaim()</methodname>
-            Methode.
-        </para>
-
-        <para>
-            In den meisten Fällen ist es nicht notwendig die <methodname>getClaim()</methodname>
-            Methode zu verwenden. Wenn es <property>requiredClaims</property> trotzdem erfordert das
-            Forderungen von verschiedenen unterschiedlichen Quellen/Namensräumen angefragt werden
-            ist es notwendig diese explizit durch Verwendung dieser Methode zu extrahieren (indem
-            einfach die komplette <acronym>URI</acronym> der Forderung übergeben wird, damit der
-            Wert von der Informationskarte empfangen werden kann). Generell gesprochen, wird die
-            <classname>Zend_InfoCard</classname> Komponente die Standard <acronym>URI</acronym> für
-            Forderungen auf eine Setzen die am häufigsten in der Informationskarte selbst verwendet
-            wird, und damit die vereinfachte Eigenschaft-Zugriffs Methode verwendet werden kann.
-        </para>
-
-        <para>
-            Als Teil des Prüfprozesses ist es am Entwickler die ausgebende Quelle der Forderung zu
-            prüfen die in der Informationskarte enthalten sind, und zu entscheiden ob diese Quelle
-            eine vertrauenswürdige Quelle von Informationen ist. Um das zu tun gibt es die
-            <methodname>getIssuer()</methodname> Methode die im
-            <classname>Zend_InfoCard_Claims</classname> Objekt angeboten wird und die
-            <acronym>URI</acronym> des Ausstellers der Forderung der Informationskarte zurückgibt.
-        </para>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.attaching">
-        <title>Informationskarten an bestehende Konten anhängen</title>
-
-        <para>
-            Es ist möglich Unterstützung für Informationskarten zu einem bestehenden
-            Authentifizierungssystem hinzuzufügen durch Speicherung des privaten persönlichen
-            Identifikators (PPI) zum vorher traditionell-authentifizierten Zugang und zumindest die
-            <filename>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier</filename>
-            Forderung als Teil der <property>requiredClaims</property> der Anfrage zu inkludieren.
-            Wenn diese Forderung angefragt wird, biete das
-            <classname>Zend_InfoCard_Claims</classname> Objekt einen eideutigen Identifikator für
-            diese spezielle Karte anzubieten die durch den Aufruf der
-            <methodname>getCardID()</methodname> Methode übermittelt wurde.
-        </para>
-
-        <para>
-            Ein Beispiel wie eine Informationskarte an einen traditionell-authentifizierten Zugang
-            angehängt werden kann wird hier gezeigt:
-        </para>
-
-        <programlisting language="php"><![CDATA[
-// ...
-public function submitinfocardAction()
-{
-    if (!isset($_REQUEST['xmlToken'])) {
-        throw new ZBlog_Exception('Verschlüsselter Token erwartet ' .
-                                  'aber nicht übergeben');
-    }
-
-    $infoCard = new Zend_InfoCard();
-    $infoCard->addCertificatePair(SSL_CERTIFICATE_PRIVATE,
-                                  SSL_CERTIFICATE_PUB);
-
-    try {
-        $claims = $infoCard->process($request['xmlToken']);
-    } catch(Zend_InfoCard_Exception $e) {
-        // TODO Fehlerbehandung durch die Anfrage
-        throw $e;
-    }
-
-    if ($claims->isValid()) {
-        $db = ZBlog_Data::getAdapter();
-
-        $ppi = $db->quote($claims->getCardID());
-        $fullname = $db->quote("{$claims->givenname} {$claims->surname}");
-
-        $query = "UPDATE blogusers
-                     SET ppi = $ppi,
-                         real_name = $fullname
-                   WHERE username='administrator'";
-
-        try {
-            $db->query($query);
-        } catch(Exception $e) {
-            // TODO Fehler beim Speichern in der DB
-        }
-
-        $this->view->render();
-        return;
-    } else {
-        throw new
-            ZBlog_Exception("Informationskarte hat die Sicherheitsprüfungen "
-                          . "nicht bestanden");
-    }
-}
-]]></programlisting>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.adapters">
-        <title>Erstellung von Zend_InfoCard Adapter</title>
-
-        <para>
-            Die <classname>Zend_InfoCard</classname> Komponente wurde entwickelt um den Wachstum im
-            Standard der Informationskarten durch die Verwendung einer modularen Architektur zu
-            erlauben. Aktuell werden viele dieser Hooks nicht verwendet und können ignoriert werden.
-            Aber es gibt einen Aspekt der in jeder seriösen Implementation von Informationskarten
-            geschrieben werden sollte: Der <classname>Zend_InfoCard</classname> Adapter.
-        </para>
-
-        <para>
-            Der <classname>Zend_InfoCard</classname> Adapter wird als Callback Mechanismus innerhalb
-            der Komponente verwendet um verschiedenste Aufgaben durchzuführen, wie das Speichern und
-            Empfangen von Assertion IDs für Informationskarten wenn diese von der Komponente
-            bearbeitet werden. Wärend das Speichern der Assertion IDs von übertragenen
-            Informationskarten nicht notwendig ist, kann das nicht Durchführen die Möglichkeit
-            eröffnen, dass das Authentifizierungs Schema durch eine Replay Attacke kompromitiert
-            wird.
-        </para>
-
-        <para>
-            Um das zu verhindern muß <classname>Zend_InfoCard_Adapter_Interface</classname>
-            implementiert werden und dann eine Instanz dieses Adapters vor dem Aufruf der
-            <methodname>process()</methodname> (alleinstehend) oder
-            <methodname>authenticate()</methodname> Methode (als ein
-            <classname>Zend_Auth</classname> Adapter) gesetzt werden. Um dieses Interface zu setzen
-            wird die <methodname>setAdapter()</methodname> Methode verwendet. Im Beispiel anbei wird
-            ein <classname>Zend_InfoCard</classname> Adapter gesetzt und innerhalb der Anwendung
-            verwendet:
-        </para>
-
-        <programlisting language="php"><![CDATA[
-class myAdapter implements Zend_InfoCard_Adapter_Interface
-{
-    public function storeAssertion($assertionURI,
-                                   $assertionID,
-                                   $conditions)
-    {
-        /* Die durch ID und URI angegebene Assertion
-           und Ihre Konditionen speichern */
-    }
-
-    public function retrieveAssertion($assertionURI, $assertionID)
-    {
-        /* Die durch URI und ID angegebene Assertion empfangen */
-    }
-
-    public function removeAssertion($assertionURI, $assertionID)
-    {
-        /* Die durch URI/ID angegebene Assertion löschen */
-    }
-}
-
-$adapter  = new myAdapter();
-
-$infoCard = new Zend_InfoCard();
-$infoCard->addCertificatePair(SSL_PRIVATE, SSL_PUB);
-$infoCard->setAdapter($adapter);
-
-$claims = $infoCard->process($_POST['xmlToken']);
-]]></programlisting>
-    </sect2>
-</sect1>

+ 0 - 5
documentation/manual/en/manual-print1.xml.in

@@ -256,11 +256,6 @@
         <xi:include href="module_specs/Zend_Http_Response.xml" />
     </chapter>
 
-    <chapter id="zend.infocard">
-        <title>Zend_InfoCard</title>
-        <xi:include href="module_specs/Zend_InfoCard-Basics.xml" />
-    </chapter>
-
     <chapter id="zend.json">
         <title>Zend_Json</title>
         <xi:include href="module_specs/Zend_Json-Introduction.xml" />

+ 0 - 9
documentation/manual/en/manual.xml.in

@@ -1172,15 +1172,6 @@
             </xi:include>
         </chapter>
 
-        <chapter id="zend.infocard">
-            <title>Zend_InfoCard</title>
-            <xi:include href="module_specs/Zend_InfoCard-Basics.xml">
-                <xi:fallback>
-                    <xi:include href="../en/module_specs/Zend_InfoCard-Basics.xml" />
-                </xi:fallback>
-            </xi:include>
-        </chapter>
-
         <chapter id="zend.json">
             <title>Zend_Json</title>
             <xi:include href="module_specs/Zend_Json-Introduction.xml">

+ 0 - 392
documentation/manual/en/module_specs/Zend_InfoCard-Basics.xml

@@ -1,392 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Reviewed: no -->
-<sect1 id="zend.infocard.basics">
-    <title>Introduction</title>
-
-    <para>
-        The <classname>Zend_InfoCard</classname> component implements relying-party
-        support for Information Cards. Information Cards are used for identity
-        management on the internet and authentication of users to web sites. The web sites
-        that the user ultimately authenticates to are called <emphasis>relying-parties</emphasis>.
-    </para>
-
-    <para>
-        Detailed information about information cards and their importance to the
-        internet identity metasystem can be found on the <ulink
-            url="http://www.identityblog.com/">IdentityBlog</ulink>.
-    </para>
-
-    <sect2 id="zend.infocard.basics.theory">
-        <title>Basic Theory of Usage</title>
-
-        <para>
-            Usage of <classname>Zend_InfoCard</classname> can be done one of two ways:
-            either as part of the larger <classname>Zend_Auth</classname> component via
-            the <classname>Zend_InfoCard</classname> authentication adapter or as a
-            stand-alone component. In both cases an information card can be
-            requested from a user by using the following <acronym>HTML</acronym> block in your
-            <acronym>HTML</acronym> login form:
-        </para>
-
-        <programlisting language="html"><![CDATA[
-<form action="http://example.com/server" method="POST">
-  <input type='image' src='/images/ic.png' align='center'
-        width='120px' style='cursor:pointer' />
-  <object type="application/x-informationCard"
-          name="xmlToken">
-   <param name="tokenType"
-         value="urn:oasis:names:tc:SAML:1.0:assertion" />
-   <param name="requiredClaims"
-         value="http://.../claims/privatepersonalidentifier
-         http://.../claims/givenname
-         http://.../claims/surname" />
- </object>
-</form>
-]]></programlisting>
-
-        <para>
-            In the example above, the <property>requiredClaims</property>
-            &lt;param&gt; tag is used to identify pieces of information known as claims (i.e.
-            person's first name, last name) which the web site (a.k.a "relying party") needs in
-            order a user to authenticate using an information card. For your reference, the full
-            <acronym>URI</acronym> (for instance the <emphasis>givenname</emphasis> claim) is as
-            follows:
-            <filename>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname</filename>
-        </para>
-
-        <para>
-            When the above <acronym>HTML</acronym> is activated by a user (clicks on it), the
-            browser will bring up a card selection program which not only shows
-            them which information cards meet the requirements of the site, but
-            also allows them to select which information card to use if multiple
-            meet the criteria. This information card is transmitted as an <acronym>XML</acronym>
-            document to the specified POST <acronym>URL</acronym> and is ready to be
-            processed by the <classname>Zend_InfoCard</classname> component.
-        </para>
-
-        <para>
-            Note, Information cards can only be <acronym>HTTP</acronym> <acronym>POST</acronym>ed to
-            <acronym>SSL</acronym>-encrypted <acronym>URL</acronym>s. Please consult your web
-            server's documentation on how to set up <acronym>SSL</acronym> encryption.
-        </para>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.auth">
-        <title>Using as part of Zend_Auth</title>
-
-        <para>
-            In order to use the component as part of the <classname>Zend_Auth</classname>
-            authentication system, you must use the provided
-            <classname>Zend_Auth_Adapter_InfoCard</classname> to do so (not available in
-            the standalone <classname>Zend_InfoCard</classname> distribution). An example
-            of its usage is shown below:
-        </para>
-
-        <programlisting language="php"><![CDATA[
-<?php
-if (isset($_POST['xmlToken'])) {
-
-    $adapter = new Zend_Auth_Adapter_InfoCard($_POST['xmlToken']);
-
-    $adapter->addCertificatePair('/usr/local/Zend/apache2/conf/server.key',
-                                 '/usr/local/Zend/apache2/conf/server.crt');
-
-    $auth = Zend_Auth::getInstance();
-
-    $result = $auth->authenticate($adapter);
-
-    switch ($result->getCode()) {
-        case Zend_Auth_Result::SUCCESS:
-            $claims = $result->getIdentity();
-            print "Given Name: {$claims->givenname}<br />";
-            print "Surname: {$claims->surname}<br />";
-            print "Email Address: {$claims->emailaddress}<br />";
-            print "PPI: {$claims->getCardID()}<br />";
-            break;
-        case Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID:
-            print "The Credential you provided did not pass validation";
-            break;
-        default:
-        case Zend_Auth_Result::FAILURE:
-            print "There was an error processing your credentials.";
-            break;
-    }
-
-    if (count($result->getMessages()) > 0) {
-        print "<pre>";
-        var_dump($result->getMessages());
-        print "</pre>";
-    }
-
-}
-?>
-<hr />
-<div id="login" style="font-family: arial; font-size: 2em;">
-<p>Simple Login Demo</p>
- <form method="post">
-  <input type="submit" value="Login" />
-   <object type="application/x-informationCard" name="xmlToken">
-    <param name="tokenType"
-          value="urn:oasis:names:tc:SAML:1.0:assertion" />
-    <param name="requiredClaims"
-          value="http://.../claims/givenname
-                 http://.../claims/surname
-                 http://.../claims/emailaddress
-                 http://.../claims/privatepersonalidentifier" />
-  </object>
- </form>
-</div>
-]]></programlisting>
-
-        <para>
-            In the example above, we first create an instance of the
-            <classname>Zend_Auth_Adapter_InfoCard</classname> and pass the <acronym>XML</acronym>
-            data posted by the card selector into it. Once an instance has been created you
-            must then provide at least one <acronym>SSL</acronym> certificate public/private key
-            pair used by the web server that received the <acronym>HTTP</acronym>
-            <acronym>POST</acronym>. These files are used to validate the destination of the
-            information posted to the server and are a requirement when using Information Cards.
-        </para>
-
-        <para>
-            Once the adapter has been configured, you can then use the standard
-            <classname>Zend_Auth</classname> facilities to validate the provided
-            information card token and authenticate the user by examining the
-            identity provided by the <methodname>getIdentity()</methodname> method.
-        </para>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.standalone">
-        <title>Using the Zend_InfoCard component standalone</title>
-
-        <para>
-            It is also possible to use the <classname>Zend_InfoCard</classname> component as a
-            standalone component by interacting with the
-            <classname>Zend_InfoCard</classname> class directly. Using the
-            <classname>Zend_InfoCard</classname> class is very similar to its use with the
-            <classname>Zend_Auth</classname> component. An example of its use is shown below:
-        </para>
-
-        <programlisting language="php"><![CDATA[
-<?php
-if (isset($_POST['xmlToken'])) {
-    $infocard = new Zend_InfoCard();
-    $infocard->addCertificatePair('/usr/local/Zend/apache2/conf/server.key',
-                                  '/usr/local/Zend/apache2/conf/server.crt');
-
-    $claims = $infocard->process($_POST['xmlToken']);
-
-    if($claims->isValid()) {
-        print "Given Name: {$claims->givenname}<br />";
-        print "Surname: {$claims->surname}<br />";
-        print "Email Address: {$claims->emailaddress}<br />";
-        print "PPI: {$claims->getCardID()}<br />";
-    } else {
-        print "Error Validating identity: {$claims->getErrorMsg()}";
-    }
-}
-?>
-<hr />
-<div id="login" style="font-family: arial; font-size: 2em;">
- <p>Simple Login Demo</p>
- <form method="post">
-  <input type="submit" value="Login" />
-   <object type="application/x-informationCard" name="xmlToken">
-    <param name="tokenType"
-          value="urn:oasis:names:tc:SAML:1.0:assertion" />
-    <param name="requiredClaims"
-          value="http://.../claims/givenname
-                 http://.../claims/surname
-                 http://.../claims/emailaddress
-                 http://.../claims/privatepersonalidentifier" />
-   </object>
- </form>
-</div>
-]]></programlisting>
-
-        <para>
-            In the example above, we use the <classname>Zend_InfoCard</classname> component
-            independently to validate the token provided by the user. As was the
-            case with the <classname>Zend_Auth_Adapter_InfoCard</classname>, we create an
-            instance of <classname>Zend_InfoCard</classname> and then set one or more
-            <acronym>SSL</acronym> certificate public/private key pairs used by the web server. Once
-            configured, we can use the <methodname>process()</methodname> method to process
-            the information card and return the results.
-        </para>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.claims">
-        <title>Working with a Claims object</title>
-
-        <para>
-            Regardless of whether the <classname>Zend_InfoCard</classname> component is used as
-            a standalone component or as part of <classname>Zend_Auth</classname> via
-            <classname>Zend_Auth_Adapter_InfoCard</classname>, the ultimate
-            result of the processing of an information card is a
-            <classname>Zend_InfoCard_Claims</classname> object. This object contains the
-            assertions (a.k.a. claims) made by the submitting user based on the
-            data requested by your web site when the user authenticated. As
-            shown in the examples above, the validity of the information card
-            can be ascertained by calling the
-            <methodname>Zend_InfoCard_Claims::isValid()</methodname> method. Claims
-            themselves can either be retrieved by simply accessing the
-            identifier desired (i.e. <property>givenname</property>) as a property of
-            the object or through the <methodname>getClaim()</methodname> method.
-        </para>
-
-        <para>
-            In most cases you will never need to use the <methodname>getClaim()</methodname>
-            method. However, if your <property>requiredClaims</property> mandate that
-            you request claims from multiple different sources/namespaces then
-            you will need to extract them explicitly using this method (simply
-            pass it the full <acronym>URI</acronym> of the claim to retrieve its value from within
-            the information card). Generally speaking however, the
-            <classname>Zend_InfoCard</classname> component will set the default
-            <acronym>URI</acronym> for claims to be the one used the most frequently within the
-            information card itself and the simplified property-access method can be used.
-        </para>
-
-        <para>
-            As part of the validation process, it is the developer's responsibility to
-            examine the issuing source of the claims contained within the
-            information card and to decide if that source is a trusted source of
-            information. To do so, the <methodname>getIssuer()</methodname> method is
-            provided within the <classname>Zend_InfoCard_Claims</classname> object which
-            returns the <acronym>URI</acronym> of the issuer of the information card claims.
-        </para>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.attaching">
-        <title>Attaching Information Cards to existing accounts</title>
-
-        <para>
-            It is possible to add support for information cards to an existing
-            authentication system by storing the private personal identifier
-            (PPI) to a previously traditionally-authenticated account and
-            including at least the
-            <filename>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier</filename>
-            claim as part of the <property>requiredClaims</property> of the request. If
-            this claim is requested then the <classname>Zend_InfoCard_Claims</classname>
-            object will provide a unique identifier for the specific card that
-            was submitted by calling the <methodname>getCardID()</methodname> method.
-        </para>
-
-        <para>
-            An example of how to attach an information card to an existing
-            traditional-authentication account is shown below:
-        </para>
-
-        <programlisting language="php"><![CDATA[
-// ...
-public function submitinfocardAction()
-{
-    if (!isset($_REQUEST['xmlToken'])) {
-        throw new ZBlog_Exception('Expected an encrypted token ' .
-                                  'but was not provided');
-    }
-
-    $infoCard = new Zend_InfoCard();
-    $infoCard->addCertificatePair(SSL_CERTIFICATE_PRIVATE,
-                                  SSL_CERTIFICATE_PUB);
-
-    try {
-        $claims = $infoCard->process($request['xmlToken']);
-    } catch(Zend_InfoCard_Exception $e) {
-        // TODO Error processing your request
-        throw $e;
-    }
-
-    if ($claims->isValid()) {
-        $db = ZBlog_Data::getAdapter();
-
-        $ppi = $db->quote($claims->getCardID());
-        $fullname = $db->quote("{$claims->givenname} {$claims->surname}");
-
-        $query = "UPDATE blogusers
-                     SET ppi = $ppi,
-                         real_name = $fullname
-                   WHERE username='administrator'";
-
-        try {
-            $db->query($query);
-        } catch(Exception $e) {
-            // TODO Failed to store in DB
-        }
-
-        $this->view->render();
-        return;
-    } else {
-        throw new
-            ZBlog_Exception("Infomation card failed security checks");
-    }
-}
-]]></programlisting>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.adapters">
-        <title>Creating Zend_InfoCard Adapters</title>
-
-        <para>
-            The <classname>Zend_InfoCard</classname> component was designed to allow for
-            growth in the information card standard through the use of a modular
-            architecture. At this time, many of these hooks are unused and can be
-            ignored, but there is one class that should be written for
-            any serious information card implementation: the
-            <classname>Zend_InfoCard</classname> adapter.
-        </para>
-
-        <para>
-            The <classname>Zend_InfoCard</classname> adapter is used as a callback
-            mechanism within the component to perform various tasks, such as
-            storing and retrieving Assertion IDs for information cards when they
-            are processed by the component. While storing the assertion IDs of
-            submitted information cards is not necessary, failing to do so opens
-            up the possibility of the authentication scheme being compromised
-            through a replay attack.
-        </para>
-
-        <para>
-            To prevent this, one must implement the
-            <classname>Zend_InfoCard_Adapter_Interface</classname> and set an
-            instance of this interface prior to calling either the
-            <methodname>process()</methodname> (standalone) or
-            <methodname>authenticate()</methodname> method as a <classname>Zend_Auth</classname>
-            adapter. To set this interface, the <methodname>setAdapter()</methodname> method should
-            be used. In the example below, we set a <classname>Zend_InfoCard</classname> adapter and
-            use it in our application:
-        </para>
-
-        <programlisting language="php"><![CDATA[
-class myAdapter implements Zend_InfoCard_Adapter_Interface
-{
-    public function storeAssertion($assertionURI,
-                                   $assertionID,
-                                   $conditions)
-    {
-        /* Store the assertion and its conditions by ID and URI */
-    }
-
-    public function retrieveAssertion($assertionURI, $assertionID)
-    {
-        /* Retrieve the assertion by URI and ID */
-    }
-
-    public function removeAssertion($assertionURI, $assertionID)
-    {
-        /* Delete a given assertion by URI/ID */
-    }
-}
-
-$adapter  = new myAdapter();
-
-$infoCard = new Zend_InfoCard();
-$infoCard->addCertificatePair(SSL_PRIVATE, SSL_PUB);
-$infoCard->setAdapter($adapter);
-
-$claims = $infoCard->process($_POST['xmlToken']);
-]]></programlisting>
-    </sect2>
-</sect1>
-<!--
-vim:se ts=4 sw=4 et:
--->

+ 0 - 25
documentation/manual/en/ref/requirements-dependencies-table.xml

@@ -129,14 +129,6 @@
             <row>
                 <entry>
                     <ulink
-                        url="&zf.manual.link;/zend.infocard.html">
-                        <classname>Zend_InfoCard</classname>
-                    </ulink>
-                </entry>
-            </row>
-            <row>
-                <entry>
-                    <ulink
                         url="&zf.manual.link;/zend.ldap.html">
                         <classname>Zend_Ldap</classname>
                     </ulink>
@@ -1929,23 +1921,6 @@
                 </entry>
             </row>
             <row>
-                <entry morerows="1" valign="middle">
-                    <emphasis>
-                        <ulink
-                            url="&zf.manual.link;/zend.infocard.html">
-                            <classname>Zend_InfoCard</classname>
-                        </ulink>
-                    </emphasis>
-                </entry>
-                <entry morerows="1" valign="middle">&requirements.hard;</entry>
-                <entry>
-                    <ulink
-                        url="&zf.manual.link;/zend.exception.html">
-                        <classname>Zend_Exception</classname>
-                    </ulink>
-                </entry>
-            </row>
-            <row>
                 <entry>
                     <ulink
                         url="&zf.manual.link;/zend.loader.html">

+ 0 - 12
documentation/manual/en/ref/requirements-zendcomponents-table.xml

@@ -482,18 +482,6 @@
                 </entry>
             </row>
             <row>
-                <entry>
-                    <emphasis>
-                        <ulink
-                            url="&zf.manual.link;/zend.infocard.html">
-                            <classname>Zend_InfoCard</classname>
-                        </ulink>
-                    </emphasis>
-                </entry>
-                <entry>---</entry>
-                <entry>---</entry>
-            </row>
-            <row>
                 <entry morerows="1" valign="middle">
                     <emphasis>
                         <ulink

+ 0 - 22
documentation/manual/es/ref/requirements-dependencies-table.xml

@@ -111,13 +111,6 @@
             </row>
             <row>
                 <entry>
-                    <ulink url="http://framework.zend.com/manual/en/zend.infocard.html">
-                        <classname>Zend_InfoCard</classname>
-                    </ulink>
-                </entry>
-            </row>
-            <row>
-                <entry>
                     <ulink url="http://framework.zend.com/manual/en/zend.ldap.html">
                         <classname>Zend_Ldap</classname>
                     </ulink>
@@ -1696,21 +1689,6 @@
                 </entry>
             </row>
             <row>
-                <entry morerows="1" valign="middle">
-                    <emphasis>
-                        <ulink url="http://framework.zend.com/manual/en/zend.infocard.html">
-                            <classname>Zend_InfoCard</classname>
-                        </ulink>
-                    </emphasis>
-                </entry>
-                <entry morerows="1" valign="middle">Hard</entry>
-                <entry>
-                    <ulink url="http://framework.zend.com/manual/en/zend.exception.html">
-                        <classname>Zend_Exception</classname>
-                    </ulink>
-                </entry>
-            </row>
-            <row>
                 <entry>
                     <ulink url="http://framework.zend.com/manual/en/zend.loader.html">
                         <classname>Zend_Loader</classname>

+ 0 - 11
documentation/manual/es/ref/requirements-zendcomponents-table.xml

@@ -415,17 +415,6 @@
                 </entry>
             </row>
             <row>
-                <entry>
-                    <emphasis>
-                        <ulink url="http://framework.zend.com/manual/en/zend.infocard.html">
-                            <classname>Zend_InfoCard</classname>
-                        </ulink>
-                    </emphasis>
-                </entry>
-                <entry>---</entry>
-                <entry>---</entry>
-            </row>
-            <row>
                 <entry morerows="1" valign="middle">
                     <emphasis>
                         <ulink url="http://framework.zend.com/manual/en/zend.json.html">

+ 0 - 13
documentation/manual/he/ref/requirements.xml

@@ -838,11 +838,6 @@
                             <entry><ulink url="http://www.php.net/manual/en/ref.mime-magic.php"><code>mime_magic</code></ulink></entry>
                         </row>
                         <row>
-                            <entry><emphasis role="strong"><ulink url="http://framework.zend.com/manual/en/zend.infocard.html"><code>Zend_InfoCard</code></ulink></emphasis></entry>
-                            <entry>---</entry>
-                            <entry>---</entry>
-                        </row>
-                        <row>
                             <entry morerows="1" valign="middle"><emphasis role="strong"><ulink url="http://framework.zend.com/manual/en/zend.json.html"><code>Zend_Json</code></ulink></emphasis></entry>
                             <entry>לא תלוי</entry>
                             <entry><ulink url="http://www.php.net/manual/en/ref.json.php"><code>json</code></ulink></entry>
@@ -1225,9 +1220,6 @@
                             <entry><ulink url="http://framework.zend.com/manual/en/zend.db.html"><code>Zend_Db</code></ulink></entry>
                         </row>
                         <row>
-                            <entry><ulink url="http://framework.zend.com/manual/en/zend.infocard.html"><code>Zend_InfoCard</code></ulink></entry>
-                        </row>
-                        <row>
                             <entry><ulink url="http://framework.zend.com/manual/en/zend.ldap.html"><code>Zend_Ldap</code></ulink></entry>
                         </row>
                         <row>
@@ -1901,11 +1893,6 @@
                             <entry><ulink url="http://framework.zend.com/manual/en/zend.registry.html"><code>Zend_Registry</code></ulink></entry>
                         </row>
                         <row>
-                            <entry morerows="1" valign="middle"><emphasis role="strong"><ulink url="http://framework.zend.com/manual/en/zend.infocard.html"><code>Zend_InfoCard</code></ulink></emphasis></entry>
-                            <entry morerows="1" valign="middle">תלוי מאוד</entry>
-                            <entry><ulink url="http://framework.zend.com/manual/en/zend.exception.html"><code>Zend_Exception</code></ulink></entry>
-                        </row>
-                        <row>
                             <entry><ulink url="http://framework.zend.com/manual/en/zend.loader.html"><code>Zend_Loader</code></ulink></entry>
                         </row>
                         <row>

+ 0 - 25
documentation/manual/hu/ref/requirements-dependencies-table.xml

@@ -121,14 +121,6 @@
             <row>
                 <entry>
                     <ulink
-                        url="http://framework.zend.com/manual/en/zend.infocard.html">
-                        <classname>Zend_InfoCard</classname>
-                    </ulink>
-                </entry>
-            </row>
-            <row>
-                <entry>
-                    <ulink
                         url="http://framework.zend.com/manual/en/zend.ldap.html">
                         <classname>Zend_Ldap</classname>
                     </ulink>
@@ -1921,23 +1913,6 @@
                 </entry>
             </row>
             <row>
-                <entry morerows="1" valign="middle">
-                    <emphasis>
-                        <ulink
-                            url="http://framework.zend.com/manual/en/zend.infocard.html">
-                            <classname>Zend_InfoCard</classname>
-                        </ulink>
-                    </emphasis>
-                </entry>
-                <entry morerows="1" valign="middle">Erős</entry>
-                <entry>
-                    <ulink
-                        url="http://framework.zend.com/manual/en/zend.exception.html">
-                        <classname>Zend_Exception</classname>
-                    </ulink>
-                </entry>
-            </row>
-            <row>
                 <entry>
                     <ulink
                         url="http://framework.zend.com/manual/en/zend.loader.html">

+ 0 - 12
documentation/manual/hu/ref/requirements-zendcomponents-table.xml

@@ -460,18 +460,6 @@
                 </entry>
             </row>
             <row>
-                <entry>
-                    <emphasis>
-                        <ulink
-                            url="http://framework.zend.com/manual/en/zend.infocard.html">
-                            <classname>Zend_InfoCard</classname>
-                        </ulink>
-                    </emphasis>
-                </entry>
-                <entry>–</entry>
-                <entry>–</entry>
-            </row>
-            <row>
                 <entry morerows="1" valign="middle">
                     <emphasis>
                         <ulink

+ 0 - 15
documentation/manual/id/ref/requirements.xml

@@ -830,12 +830,6 @@
                         <entry><ulink url="http://www.php.net/manual/en/ref.mime-magic.php"><code>mime_magic</code></ulink></entry>
                     </row>
                     <row>
-                        <entry><emphasis role="strong"><ulink url="http://framework.zend.com/manual/en/zend.infocard.html"><code>Zend_InfoCard</code></ulink></emphasis></entry>
-                        <entry>---</entry>
-                        <entry>---</entry>
-                        <entry>---</entry>
-                    </row>
-                    <row>
                         <entry morerows="1" valign="middle"><emphasis role="strong"><ulink url="http://framework.zend.com/manual/en/zend.json.html"><code>Zend_Json</code></ulink></emphasis></entry>
                         <entry>Soft</entry>
                         <entry>---</entry>
@@ -1211,9 +1205,6 @@
                         <entry><ulink url="http://framework.zend.com/manual/en/zend.db.html"><code>Zend_Db</code></ulink></entry>
                     </row>
                     <row>
-                        <entry><ulink url="http://framework.zend.com/manual/en/zend.infocard.html"><code>Zend_InfoCard</code></ulink></entry>
-                    </row>
-                    <row>
                         <entry><ulink url="http://framework.zend.com/manual/en/zend.ldap.html"><code>Zend_Ldap</code></ulink></entry>
                     </row>
                     <row>
@@ -1398,11 +1389,6 @@
                         <entry><ulink url="http://framework.zend.com/manual/en/zend.uri.html"><code>Zend_Uri</code></ulink></entry>
                     </row>
                     <row>
-                        <entry><emphasis role="strong"><ulink url="http://framework.zend.com/manual/en/zend.infocard.html"><code>Zend_InfoCard</code></ulink></emphasis></entry>
-                        <entry>Hard</entry>
-                        <entry><ulink url="http://framework.zend.com/manual/en/zend.loader.html"><code>Zend_Loader</code></ulink></entry>
-                    </row>
-                    <row>
                         <entry><emphasis role="strong"><ulink url="http://framework.zend.com/manual/en/zend.json.html"><code>Zend_Json</code></ulink></emphasis></entry>
                         <entry>Hard</entry>
                         <entry><ulink url="http://framework.zend.com/manual/en/zend.exception.html"><code>Zend_Exception</code></ulink></entry>
@@ -1802,7 +1788,6 @@ Filter
 Form
 Gdata
 Http
-InfoCard
 Json
 Layout
 Ldap

+ 0 - 404
documentation/manual/ja/module_specs/Zend_InfoCard-Basics.xml

@@ -1,404 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Reviewed: no -->
-<!-- EN-Revision: 24249 -->
-<sect1 id="zend.infocard.basics">
-    <title>導入</title>
-    <!-- Skip-EN-Revisions: 22747 -->
-    <para>注意:このドキュメントでは、英語版のリビジョン 22747 の更新内容をスキップしています。</para>
-    <para>
-        <classname>Zend_InfoCard</classname> コンポーネントは、
-        情報カード (Information Cards) の relying-party
-        サポートを実装したものです。
-        情報カードは、インターネット上でのユーザ識別情報の管理や
-        ウェブサイトのユーザ認証に用いるものです。
-        最終的にユーザ認証を行う先のウェブサイトのことを
-        <emphasis>relying-party</emphasis> といいます。
-    </para>
-
-    <para>
-        情報カードについて、
-        あるいはインターネット上の識別メタシステムにおける情報カードの重要性については、
-        <ulink url="http://www.identityblog.com/">IdentityBlog</ulink>
-        を参照ください。
-    </para>
-
-    <sect2 id="zend.infocard.basics.theory">
-        <title>基本的な使用法</title>
-
-        <para>
-            <classname>Zend_InfoCard</classname> の使用法は、
-            <classname>Zend_Auth</classname> コンポーネントの一部として
-            <classname>Zend_InfoCard</classname> 認証アダプタを使用するか、
-            あるいは単体のコンポーネントとして使用するかのいずれかです。
-            どちらの場合についても、ユーザから情報カードを受け取るには
-            <acronym>HTML</acronym> のログインフォームの中で次のような <acronym>HTML</acronym> ブロックを使用します。
-        </para>
-
-        <programlisting language="html"><![CDATA[
-<form action="http://example.com/server" method="POST">
-  <input type='image' src='/images/ic.png' align='center'
-        width='120px' style='cursor:pointer' />
-  <object type="application/x-informationCard"
-          name="xmlToken">
-   <param name="tokenType"
-         value="urn:oasis:names:tc:SAML:1.0:assertion" />
-   <param name="requiredClaims"
-         value="http://.../claims/privatepersonalidentifier
-         http://.../claims/givenname
-         http://.../claims/surname" />
- </object>
-</form>
-]]></programlisting>
-
-        <para>
-            この例において、<code>requiredClaims</code>
-            <code>&lt;param&gt;</code> タグで表しているのが、
-            claim (人の姓名など) と呼ばれる識別情報です。
-            これは、ウェブサイト ("relying party")
-            が情報カードによる認証を行うために必要となります。
-        </para>
-
-        <para>
-            上の <acronym>HTML</acronym> をユーザが実行する (クリックする) と、
-            ブラウザはカード選択プログラムを実行します。
-            これは、そのサイトの要求を満たす情報カードを表示させるだけでなく、
-            条件を満たす情報カードが複数存在する場合に好きなものを選択させることができます。
-            この情報カードは、指定した <acronym>URL</acronym> に <acronym>XML</acronym> ドキュメントとして
-            <code>POST</code> され、これを
-            <classname>Zend_InfoCard</classname> コンポーネントで処理することになります。
-        </para>
-
-        <para>
-            情報カードは、<acronym>SSL</acronym> で暗号化した <acronym>URL</acronym> への
-            <code>HTTP POST</code> しかできないことに注意しましょう。
-            <acronym>SSL</acronym> による暗号化を設定する方法については、
-            ウェブサーバのドキュメントを参照ください。
-        </para>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.auth">
-        <title>Zend_Auth の部品としての使用法</title>
-
-        <para>
-            このコンポーネントを <classname>Zend_Auth</classname>
-            認証システムと組み合わせて使用するには、
-            <classname>Zend_Auth_Adapter_InfoCard</classname> を使用する必要があります
-            (これは、単体で配布されている <classname>Zend_InfoCard</classname>
-            には存在しません)。
-            この手法での使用例を以下に示します。
-        </para>
-
-        <programlisting language="php"><![CDATA[
-<?php
-if (isset($_POST['xmlToken'])) {
-
-    $adapter = new Zend_Auth_Adapter_InfoCard($_POST['xmlToken']);
-
-    $adapter->addCertificatePair('/usr/local/Zend/apache2/conf/server.key',
-                                 '/usr/local/Zend/apache2/conf/server.crt');
-
-
-    $auth = Zend_Auth::getInstance();
-
-    $result = $auth->authenticate($adapter);
-
-    switch ($result->getCode()) {
-        case Zend_Auth_Result::SUCCESS:
-            $claims = $result->getIdentity();
-            print "Given Name: {$claims->givenname}<br />";
-            print "Surname: {$claims->surname}<br />";
-            print "Email Address: {$claims->emailaddress}<br />";
-            print "PPI: {$claims->getCardID()}<br />";
-            break;
-        case Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID:
-            print "The Credential you provided did not pass validation";
-            break;
-        default:
-        case Zend_Auth_Result::FAILURE:
-            print "There was an error processing your credentials.";
-            break;
-    }
-
-    if (count($result->getMessages()) > 0) {
-        print "<pre>";
-        var_dump($result->getMessages());
-        print "</pre>";
-    }
-
-}
-?>
-<hr />
-<div id="login" style="font-family: arial; font-size: 2em;">
-<p>Simple Login Demo</p>
- <form method="post">
-  <input type="submit" value="Login" />
-   <object type="application/x-informationCard" name="xmlToken">
-    <param name="tokenType"
-          value="urn:oasis:names:tc:SAML:1.0:assertion" />
-    <param name="requiredClaims"
-          value="http://.../claims/givenname
-                 http://.../claims/surname
-                 http://.../claims/emailaddress
-                 http://.../claims/privatepersonalidentifier" />
-  </object>
- </form>
-</div>
-]]></programlisting>
-
-        <para>
-            上の例では、まず最初に
-            <classname>Zend_Auth_Adapter_InfoCard</classname> のインスタンスを作成して、
-            カードセレクタから送信された <acronym>XML</acronym> データをそこに渡しています。
-            インスタンスを作成したら、次に <acronym>SSL</acronym> 証明書の秘密鍵/公開鍵
-            ペアを指定する必要があります。
-            このペアは、<code>HTTP POST</code>
-            を受け取ったウェブサーバで使用しているものです。
-            これらのファイルを使用して、サーバに送信された情報のあて先の検証を行います。
-            情報カードを使用するときにはこれらが必要となります。
-        </para>
-
-        <para>
-            アダプタの設定がすんだら、あとは
-            <classname>Zend_Auth</classname> の標準機能を使って情報カードトークンの検証を行い、
-            <methodname>getIdentity()</methodname> で取得した識別情報をもとにユーザの認証を行います。
-        </para>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.standalone">
-        <title>Zend_InfoCard コンポーネント単体での使用法</title>
-
-        <para>
-            <classname>Zend_InfoCard</classname> コンポーネントを、
-            それ単体で使用することも可能です。その場合は
-            <classname>Zend_InfoCard</classname> クラスを直接操作します。
-            <classname>Zend_InfoCard</classname> クラスの使用法は、<classname>Zend_Auth</classname>
-            コンポーネントと組み合わせて使用する場合とほぼ同じです。
-            以下に使用例を示します。
-        </para>
-
-        <programlisting language="php"><![CDATA[
-<?php
-if (isset($_POST['xmlToken'])) {
-    $infocard = new Zend_InfoCard();
-    $infocard->addCertificatePair('/usr/local/Zend/apache2/conf/server.key',
-                                  '/usr/local/Zend/apache2/conf/server.crt');
-
-    $claims = $infocard->process($_POST['xmlToken']);
-
-    if($claims->isValid()) {
-        print "Given Name: {$claims->givenname}<br />";
-        print "Surname: {$claims->surname}<br />";
-        print "Email Address: {$claims->emailaddress}<br />";
-        print "PPI: {$claims->getCardID()}<br />";
-    } else {
-        print "Error Validating identity: {$claims->getErrorMsg()}";
-    }
-}
-?>
-<hr />
-<div id="login" style="font-family: arial; font-size: 2em;">
-<p>Simple Login Demo</p>
- <form method="post">
-  <input type="submit" value="Login" />
-   <object type="application/x-informationCard" name="xmlToken">
-    <param name="tokenType"
-          value="urn:oasis:names:tc:SAML:1.0:assertion" />
-    <param name="requiredClaims"
-          value="http://.../claims/givenname
-                 http://.../claims/surname
-                 http://.../claims/emailaddress
-                 http://.../claims/privatepersonalidentifier" />
-   </object>
- </form>
-</div>
-]]></programlisting>
-
-        <para>
-            上の例では、<classname>Zend_InfoCard</classname>
-            コンポーネントを単体で使用して、ユーザが送信したトークンを検証しています。
-            <classname>Zend_Auth_Adapter_InfoCard</classname> の場合と同様、
-            <classname>Zend_InfoCard</classname> のインスタンスを作成してから
-            ウェブサーバの <acronym>SSL</acronym> 証明書の公開キー/秘密キーペアを設定します。
-            設定がすんだら、<methodname>process()</methodname>
-            メソッドで情報カードの処理を行ってその結果を返します。
-        </para>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.claims">
-        <title>Claims オブジェクトの使用法</title>
-
-        <para>
-            <classname>Zend_InfoCard</classname> の使用方法
-            (単体で使用するか、あるいは <classname>Zend_Auth</classname> の一部として
-            <classname>Zend_Auth_Adapter_InfoCard</classname> 経由で使用するか)
-            にかかわらず、情報カードを処理した結果は
-            <classname>Zend_InfoCard_Claims</classname> オブジェクトとして返されます。
-            このオブジェクトには assertions (claims) が含まれます。
-            これは、ユーザ認証の際にあなたのサイトが出した要求にもとづいて、
-            ユーザが送信したデータから作成したものです。
-            上の例で示したように、情報カードの妥当性を確認するには
-            <methodname>Zend_InfoCard_Claims::isValid()</methodname>
-            メソッドをコールします。claims そのものを取得するには、
-            単純に識別子 (<code>givenname</code> など)
-            をオブジェクトのプロパティとして指定してアクセスするか、
-            あるいは <methodname>getClaim()</methodname> メソッドを使用します。
-        </para>
-
-        <para>
-            ほとんどの場合においては <methodname>getClaim()</methodname>
-            メソッドを使用する必要はありません。
-            しかし、もし <code>requiredClaims</code>
-            が複数の異なるソース/名前空間からの情報を要求している場合は、
-            それをこのメソッドで明示的に取り出す必要があります
-            (claim の完全な <acronym>URI</acronym> を私、情報カードの中からその値を取得します)。
-            一般論として、<classname>Zend_InfoCard</classname>
-            コンポーネントがデフォルトで設定する claim 用 <acronym>URI</acronym>
-            は情報カードの中で最もよく用いられるものです。
-            この場合は単純にプロパティを使用してアクセスできます。
-        </para>
-
-        <para>
-            検証処理の中で開発者が行わなければならない部分は、
-            情報カード内の claim の発行元を調べて
-            それが信頼できる情報元かどうかを判定するところです。
-            これを行うために、<classname>Zend_InfoCard_Claims</classname>
-            オブジェクトには <methodname>getIssuer()</methodname> メソッドが用意されています。
-            このメソッドは、情報カードの claim の発行元 <acronym>URI</acronym> を返します。
-        </para>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.attaching">
-        <title>既存のアカウントへの情報カードの添付</title>
-
-        <para>
-            既存の認証システムに情報カードのサポートを追加することもできます。
-            そのためには、private personal identifier
-            (PPI) を昔ながらの認証アカウントに埋め込み、
-            最低限の claim である
-            <code>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier</code>
-            をリクエストの <code>requiredClaims</code>
-            に指定します。この claim が要求されると、
-            <classname>Zend_InfoCard_Claims</classname>
-            オブジェクトはそのカード用の一意な識別子を用意します。
-            これは、<methodname>getCardID()</methodname> メソッドによって行います。
-        </para>
-
-        <para>
-            情報カードを既存の昔ながらの認証アカウントに添付する例を、
-            以下に示します。
-        </para>
-
-        <programlisting language="php"><![CDATA[
-// ...
-public function submitinfocardAction()
-{
-    if (!isset($_REQUEST['xmlToken'])) {
-        throw new ZBlog_Exception('Expected an encrypted token ' .
-                                  'but was not provided');
-    }
-
-    $infoCard = new Zend_InfoCard();
-    $infoCard->addCertificatePair(SSL_CERTIFICATE_PRIVATE,
-                                  SSL_CERTIFICATE_PUB);
-
-    try {
-        $claims = $infoCard->process($request['xmlToken']);
-    } catch(Zend_InfoCard_Exception $e) {
-        // TODO Error processing your request
-        throw $e;
-    }
-
-    if ($claims->isValid()) {
-        $db = ZBlog_Data::getAdapter();
-
-        $ppi = $db->quote($claims->getCardID());
-        $fullname = $db->quote("{$claims->givenname} {$claims->surname}");
-
-        $query = "UPDATE blogusers
-                     SET ppi = $ppi,
-                         real_name = $fullname
-                   WHERE username='administrator'";
-
-        try {
-            $db->query($query);
-        } catch(Exception $e) {
-            // TODO Failed to store in DB
-        }
-
-        $this->view->render();
-        return;
-    } else {
-        throw new
-            ZBlog_Exception("Infomation card failed security checks");
-    }
-}
-]]></programlisting>
-    </sect2>
-
-    <sect2 id="zend.infocard.basics.adapters">
-        <title>Zend_InfoCard アダプタの作成</title>
-
-        <para>
-            <classname>Zend_InfoCard</classname> コンポーネントは、
-            情報カードの標準規格の変化に対応するために
-            モジュラー構造を採用しています。
-            現時点では、拡張ポイントの多くは未使用ですので無視できますが、
-            情報カードの実装においてひとつだけ実装すべき点があります。
-            それが <classname>Zend_InfoCard_Adapter</classname> です。
-        </para>
-
-        <para>
-            <classname>Zend_InfoCard</classname> アダプタは、
-            コンポーネント内でコールバックを使用してさまざまな処理を行います。
-            たとえば、コンポーネントが情報カードを処理する際の
-            Assertion ID の保存や取得などを行います。
-            受け取った情報カードの assertion ID の保存は必須ではありませんが、
-            もしそれに失敗すると、リプレイ攻撃によって認証が信頼できないものになる可能性が発生します。
-        </para>
-
-        <para>
-            これを避けるためには、
-            <classname>Zend_InfoCard_Adapter_Interface</classname>
-            を実装してそのインスタンスを設定してから
-            <methodname>process()</methodname> メソッド (単体) あるいは <methodname>authenticate()</methodname>
-            メソッド (<classname>Zend_Auth</classname> アダプタ) をコールしなければなりません。
-            このインターフェイスを設定するためのメソッドが
-            <methodname>setAdapter()</methodname> です。
-            以下の例では、<classname>Zend_InfoCard</classname>
-            アダプタを設定してアプリケーション内で使用しています。
-        </para>
-
-        <programlisting language="php"><![CDATA[
-class myAdapter implements Zend_InfoCard_Adapter_Interface
-{
-    public function storeAssertion($assertionURI,
-                                   $assertionID,
-                                   $conditions)
-    {
-        /* Store the assertion and its conditions by ID and URI */
-    }
-
-    public function retrieveAssertion($assertionURI, $assertionID)
-    {
-        /* Retrieve the assertion by URI and ID */
-    }
-
-    public function removeAssertion($assertionURI, $assertionID)
-    {
-        /* Delete a given assertion by URI/ID */
-    }
-}
-
-$adapter  = new myAdapter();
-
-$infoCard = new Zend_InfoCard();
-$infoCard->addCertificatePair(SSL_PRIVATE, SSL_PUB);
-$infoCard->setAdapter($adapter);
-
-$claims = $infoCard->process($_POST['xmlToken']);
-]]></programlisting>
-    </sect2>
-</sect1>
-<!--
-vim:se ts=4 sw=4 et:
--->

+ 0 - 15
documentation/manual/pl/ref/requirements.xml

@@ -839,12 +839,6 @@
                         <entry><ulink url="http://www.php.net/manual/en/ref.mime-magic.php"><code>mime_magic</code></ulink></entry>
                     </row>
                     <row>
-                        <entry><emphasis role="strong"><ulink url="http://framework.zend.com/manual/en/zend.infocard.html"><code>Zend_InfoCard</code></ulink></emphasis></entry>
-                        <entry>---</entry>
-                        <entry>---</entry>
-                        <entry>---</entry>
-                    </row>
-                    <row>
                         <entry morerows="1" valign="middle"><emphasis role="strong"><ulink url="http://framework.zend.com/manual/en/zend.json.html"><code>Zend_Json</code></ulink></emphasis></entry>
                         <entry>Słaba</entry>
                         <entry>---</entry>
@@ -1220,9 +1214,6 @@
                         <entry><ulink url="http://framework.zend.com/manual/en/zend.db.html"><code>Zend_Db</code></ulink></entry>
                     </row>
                     <row>
-                        <entry><ulink url="http://framework.zend.com/manual/en/zend.infocard.html"><code>Zend_InfoCard</code></ulink></entry>
-                    </row>
-                    <row>
                         <entry><ulink url="http://framework.zend.com/manual/en/zend.ldap.html"><code>Zend_Ldap</code></ulink></entry>
                     </row>
                     <row>
@@ -1407,11 +1398,6 @@
                         <entry><ulink url="http://framework.zend.com/manual/en/zend.uri.html"><code>Zend_Uri</code></ulink></entry>
                     </row>
                     <row>
-                        <entry><emphasis role="strong"><ulink url="http://framework.zend.com/manual/en/zend.infocard.html"><code>Zend_InfoCard</code></ulink></emphasis></entry>
-                        <entry>Silna</entry>
-                        <entry><ulink url="http://framework.zend.com/manual/en/zend.loader.html"><code>Zend_Loader</code></ulink></entry>
-                    </row>
-                    <row>
                         <entry><emphasis role="strong"><ulink url="http://framework.zend.com/manual/en/zend.json.html"><code>Zend_Json</code></ulink></emphasis></entry>
                         <entry>Silna</entry>
                         <entry><ulink url="http://framework.zend.com/manual/en/zend.exception.html"><code>Zend_Exception</code></ulink></entry>
@@ -1811,7 +1797,6 @@ Filter
 Form
 Gdata
 Http
-InfoCard
 Json
 Layout
 Ldap

+ 0 - 497
library/Zend/InfoCard.php

@@ -1,497 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_EncryptedData
- */
-require_once 'Zend/InfoCard/Xml/EncryptedData.php';
-
-/**
- * Zend_InfoCard_Xml_Assertion
- */
-require_once 'Zend/InfoCard/Xml/Assertion.php';
-
-/**
- * Zend_InfoCard_Cipher
- */
-require_once 'Zend/InfoCard/Cipher.php';
-
-/**
- * Zend_InfoCard_Xml_Security
- */
-require_once 'Zend/InfoCard/Xml/Security.php';
-
-/**
- * Zend_InfoCard_Adapter_Interface
- */
-require_once 'Zend/InfoCard/Adapter/Interface.php';
-
-/**
- * Zend_InfoCard_Claims
- */
-require_once 'Zend/InfoCard/Claims.php';
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard
-{
-    /**
-     * URI for XML Digital Signature SHA1 Digests
-     */
-    const DIGEST_SHA1        = 'http://www.w3.org/2000/09/xmldsig#sha1';
-
-    /**
-     * An array of certificate pair files and optional passwords for them to search
-     * when trying to determine which certificate was used to encrypt the transient key
-     *
-     * @var Array
-     */
-    protected $_keyPairs;
-
-    /**
-     * The instance to use to decrypt public-key encrypted data
-     *
-     * @var Zend_InfoCard_Cipher_Pki_Interface
-     */
-    protected $_pkiCipherObj;
-
-    /**
-     * The instance to use to decrypt symmetric encrypted data
-     *
-     * @var Zend_InfoCard_Cipher_Symmetric_Interface
-     */
-    protected $_symCipherObj;
-
-    /**
-     * The InfoCard Adapter to use for callbacks into the application using the component
-     * such as when storing assertions, etc.
-     *
-     * @var Zend_InfoCard_Adapter_Interface
-     */
-    protected $_adapter;
-
-
-    /**
-     * InfoCard Constructor
-     *
-     * @throws Zend_InfoCard_Exception
-     */
-    public function __construct()
-    {
-        $this->_keyPairs = array();
-
-        if(!extension_loaded('mcrypt')) {
-            require_once 'Zend/InfoCard/Exception.php';
-            throw new Zend_InfoCard_Exception("Use of the Zend_InfoCard component requires the mcrypt extension to be enabled in PHP");
-        }
-
-        if(!extension_loaded('openssl')) {
-            require_once 'Zend/InfoCard/Exception.php';
-            throw new Zend_InfoCard_Exception("Use of the Zend_InfoCard component requires the openssl extension to be enabled in PHP");
-        }
-    }
-
-    /**
-     * Sets the adapter uesd for callbacks into the application using the component, used
-     * when doing things such as storing / retrieving assertions, etc.
-     *
-     * @param Zend_InfoCard_Adapter_Interface $a The Adapter instance
-     * @return Zend_InfoCard The instnace
-     */
-    public function setAdapter(Zend_InfoCard_Adapter_Interface $a)
-    {
-        $this->_adapter = $a;
-        return $this;
-    }
-
-    /**
-     * Retrieves the adapter used for callbacks into the application using the component.
-     * If no adapter was set then an instance of Zend_InfoCard_Adapter_Default is used
-     *
-     * @return Zend_InfoCard_Adapter_Interface The Adapter instance
-     */
-    public function getAdapter()
-    {
-        if($this->_adapter === null) {
-            require_once 'Zend/InfoCard/Adapter/Default.php';
-            $this->setAdapter(new Zend_InfoCard_Adapter_Default());
-        }
-
-        return $this->_adapter;
-    }
-
-    /**
-     * Gets the Public Key Cipher object used in this instance
-     *
-     * @return Zend_InfoCard_Cipher_Pki_Interface
-     */
-    public function getPkiCipherObject()
-    {
-        return $this->_pkiCipherObj;
-    }
-
-    /**
-     * Sets the Public Key Cipher Object used in this instance
-     *
-     * @param Zend_InfoCard_Cipher_Pki_Interface $cipherObj
-     * @return Zend_InfoCard
-     */
-    public function setPkiCipherObject(Zend_InfoCard_Cipher_Pki_Interface $cipherObj)
-    {
-        $this->_pkiCipherObj = $cipherObj;
-        return $this;
-    }
-
-    /**
-     * Get the Symmetric Cipher Object used in this instance
-     *
-     * @return Zend_InfoCard_Cipher_Symmetric_Interface
-     */
-    public function getSymCipherObject()
-    {
-        return $this->_symCipherObj;
-    }
-
-    /**
-     * Sets the Symmetric Cipher Object used in this instance
-     *
-     * @param Zend_InfoCard_Cipher_Symmetric_Interface $cipherObj
-     * @return Zend_InfoCard
-     */
-    public function setSymCipherObject($cipherObj)
-    {
-        $this->_symCipherObj = $cipherObj;
-        return $this;
-    }
-
-    /**
-     * Remove a Certificate Pair by Key ID from the search list
-     *
-     * @throws Zend_InfoCard_Exception
-     * @param string $key_id The Certificate Key ID returned from adding the certificate pair
-     * @return Zend_InfoCard
-     */
-    public function removeCertificatePair($key_id)
-    {
-
-        if(!key_exists($key_id, $this->_keyPairs)) {
-            require_once 'Zend/InfoCard/Exception.php';
-            throw new Zend_InfoCard_Exception("Attempted to remove unknown key id: $key_id");
-        }
-
-        unset($this->_keyPairs[$key_id]);
-        return $this;
-    }
-
-    /**
-     * Add a Certificate Pair to the list of certificates searched by the component
-     *
-     * @throws Zend_InfoCard_Exception
-     * @param string $private_key_file The path to the private key file for the pair
-     * @param string $public_key_file The path to the certificate / public key for the pair
-     * @param string $type (optional) The URI for the type of key pair this is (default RSA with OAEP padding)
-     * @param string $password (optional) The password for the private key file if necessary
-     * @return string A key ID representing this key pair in the component
-     */
-    public function addCertificatePair($private_key_file, $public_key_file, $type = Zend_InfoCard_Cipher::ENC_RSA_OAEP_MGF1P, $password = null)
-    {
-        if(!file_exists($private_key_file) ||
-           !file_exists($public_key_file)) {
-            require_once 'Zend/InfoCard/Exception.php';
-            throw new Zend_InfoCard_Exception("Could not locate the public and private certificate pair files: $private_key_file, $public_key_file");
-        }
-
-        if(!is_readable($private_key_file) ||
-           !is_readable($public_key_file)) {
-            require_once 'Zend/InfoCard/Exception.php';
-            throw new Zend_InfoCard_Exception("Could not read the public and private certificate pair files (check permissions): $private_key_file, $public_key_file");
-        }
-
-        $key_id = md5($private_key_file.$public_key_file);
-
-        if(key_exists($key_id, $this->_keyPairs)) {
-            require_once 'Zend/InfoCard/Exception.php';
-            throw new Zend_InfoCard_Exception("Attempted to add previously existing certificate pair: $private_key_file, $public_key_file");
-        }
-
-        switch($type) {
-            case Zend_InfoCard_Cipher::ENC_RSA:
-            case Zend_InfoCard_Cipher::ENC_RSA_OAEP_MGF1P:
-                $this->_keyPairs[$key_id] = array('private' => $private_key_file,
-                                'public'      => $public_key_file,
-                                'type_uri'    => $type);
-
-                if($password !== null) {
-                    $this->_keyPairs[$key_id]['password'] = $password;
-                } else {
-                    $this->_keyPairs[$key_id]['password'] = null;
-                }
-
-                return $key_id;
-                break;
-            default:
-                require_once 'Zend/InfoCard/Exception.php';
-                throw new Zend_InfoCard_Exception("Invalid Certificate Pair Type specified: $type");
-        }
-    }
-
-    /**
-     * Return a Certificate Pair from a key ID
-     *
-     * @throws Zend_InfoCard_Exception
-     * @param string $key_id The Key ID of the certificate pair in the component
-     * @return array An array containing the path to the private/public key files,
-     *               the type URI and the password if provided
-     */
-    public function getCertificatePair($key_id)
-    {
-        if(key_exists($key_id, $this->_keyPairs)) {
-            return $this->_keyPairs[$key_id];
-        }
-
-        require_once 'Zend/InfoCard/Exception.php';
-        throw new Zend_InfoCard_Exception("Invalid Certificate Pair ID provided: $key_id");
-    }
-
-    /**
-     * Retrieve the digest of a given public key / certificate using the provided digest
-     * method
-     *
-     * @throws Zend_InfoCard_Exception
-     * @param string $key_id The certificate key id in the component
-     * @param string $digestMethod The URI of the digest method to use (default SHA1)
-     * @return string The digest value in binary format
-     */
-    protected function _getPublicKeyDigest($key_id, $digestMethod = self::DIGEST_SHA1)
-    {
-        $certificatePair = $this->getCertificatePair($key_id);
-
-        $temp = file($certificatePair['public']);
-        unset($temp[count($temp)-1]);
-        unset($temp[0]);
-        $certificateData = base64_decode(implode("\n", $temp));
-
-        switch($digestMethod) {
-            case self::DIGEST_SHA1:
-                $digest_retval = sha1($certificateData, true);
-                break;
-            default:
-                require_once 'Zend/InfoCard/Exception.php';
-                throw new Zend_InfoCard_Exception("Invalid Digest Type Provided: $digestMethod");
-        }
-
-        return $digest_retval;
-    }
-
-    /**
-     * Find a certificate pair based on a digest of its public key / certificate file
-     *
-     * @param string $digest The digest value of the public key wanted in binary form
-     * @param string $digestMethod The URI of the digest method used to calculate the digest
-     * @return mixed The Key ID of the matching certificate pair or false if not found
-     */
-    protected function _findCertifiatePairByDigest($digest, $digestMethod = self::DIGEST_SHA1)
-    {
-
-        foreach($this->_keyPairs as $key_id => $certificate_data) {
-
-            $cert_digest = $this->_getPublicKeyDigest($key_id, $digestMethod);
-
-            if($cert_digest == $digest) {
-                return $key_id;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Extracts the Signed Token from an EncryptedData block
-     *
-     * @throws Zend_InfoCard_Exception
-     * @param string $strXmlToken The EncryptedData XML block
-     * @return string The XML of the Signed Token inside of the EncryptedData block
-     */
-    protected function _extractSignedToken($strXmlToken)
-    {
-        $encryptedData = Zend_InfoCard_Xml_EncryptedData::getInstance($strXmlToken);
-
-        // Determine the Encryption Method used to encrypt the token
-
-        switch($encryptedData->getEncryptionMethod()) {
-            case Zend_InfoCard_Cipher::ENC_AES128CBC:
-            case Zend_InfoCard_Cipher::ENC_AES256CBC:
-                break;
-            default:
-                require_once 'Zend/InfoCard/Exception.php';
-                throw new Zend_InfoCard_Exception("Unknown Encryption Method used in the secure token");
-        }
-
-        // Figure out the Key we are using to decrypt the token
-
-        $keyinfo = $encryptedData->getKeyInfo();
-
-        if(!($keyinfo instanceof Zend_InfoCard_Xml_KeyInfo_XmlDSig)) {
-            require_once 'Zend/InfoCard/Exception.php';
-            throw new Zend_InfoCard_Exception("Expected a XML digital signature KeyInfo, but was not found");
-        }
-
-
-        $encryptedKey = $keyinfo->getEncryptedKey();
-
-        switch($encryptedKey->getEncryptionMethod()) {
-            case Zend_InfoCard_Cipher::ENC_RSA:
-            case Zend_InfoCard_Cipher::ENC_RSA_OAEP_MGF1P:
-                break;
-            default:
-                require_once 'Zend/InfoCard/Exception.php';
-                throw new Zend_InfoCard_Exception("Unknown Key Encryption Method used in secure token");
-        }
-
-        $securityTokenRef = $encryptedKey->getKeyInfo()->getSecurityTokenReference();
-
-        $key_id = $this->_findCertifiatePairByDigest($securityTokenRef->getKeyReference());
-
-        if(!$key_id) {
-            require_once 'Zend/InfoCard/Exception.php';
-            throw new Zend_InfoCard_Exception("Unable to find key pair used to encrypt symmetric InfoCard Key");
-        }
-
-        $certificate_pair = $this->getCertificatePair($key_id);
-
-        // Santity Check
-
-        if($certificate_pair['type_uri'] != $encryptedKey->getEncryptionMethod()) {
-            require_once 'Zend/InfoCard/Exception.php';
-            throw new Zend_InfoCard_Exception("Certificate Pair which matches digest is not of same algorithm type as document, check addCertificate()");
-        }
-
-        $PKcipher = Zend_InfoCard_Cipher::getInstanceByURI($encryptedKey->getEncryptionMethod());
-
-        $base64DecodeSupportsStrictParam = version_compare(PHP_VERSION, '5.2.0', '>=');
-
-        if ($base64DecodeSupportsStrictParam) {
-            $keyCipherValueBase64Decoded = base64_decode($encryptedKey->getCipherValue(), true);
-        } else {
-            $keyCipherValueBase64Decoded = base64_decode($encryptedKey->getCipherValue());
-        }
-
-        $symmetricKey = $PKcipher->decrypt(
-            $keyCipherValueBase64Decoded,
-            file_get_contents($certificate_pair['private']),
-            $certificate_pair['password']
-            );
-
-        $symCipher = Zend_InfoCard_Cipher::getInstanceByURI($encryptedData->getEncryptionMethod());
-
-        if ($base64DecodeSupportsStrictParam) {
-            $dataCipherValueBase64Decoded = base64_decode($encryptedData->getCipherValue(), true);
-        } else {
-            $dataCipherValueBase64Decoded = base64_decode($encryptedData->getCipherValue());
-        }
-
-        $signedToken = $symCipher->decrypt($dataCipherValueBase64Decoded, $symmetricKey);
-
-        return $signedToken;
-    }
-
-    /**
-     * Process an input Infomation Card EncryptedData block sent from the client,
-     * validate it, and return the claims contained within it on success or an error message on error
-     *
-     * @param string $strXmlToken The XML token sent to the server from the client
-     * @return Zend_Infocard_Claims The Claims object containing the claims, or any errors which occurred
-     */
-    public function process($strXmlToken)
-    {
-
-        $retval = new Zend_InfoCard_Claims();
-
-        require_once 'Zend/InfoCard/Exception.php';
-        try {
-            $signedAssertionsXml = $this->_extractSignedToken($strXmlToken);
-        } catch(Zend_InfoCard_Exception $e) {
-            $retval->setError('Failed to extract assertion document');
-            $retval->setCode(Zend_InfoCard_Claims::RESULT_PROCESSING_FAILURE);
-            return $retval;
-        }
-
-        try {
-            $assertions = Zend_InfoCard_Xml_Assertion::getInstance($signedAssertionsXml);
-        } catch(Zend_InfoCard_Exception $e) {
-            $retval->setError('Failure processing assertion document');
-            $retval->setCode(Zend_InfoCard_Claims::RESULT_PROCESSING_FAILURE);
-            return $retval;
-        }
-
-        if(!($assertions instanceof Zend_InfoCard_Xml_Assertion_Interface)) {
-            throw new Zend_InfoCard_Exception("Invalid Assertion Object returned");
-        }
-
-        if(!($reference_id = Zend_InfoCard_Xml_Security::validateXMLSignature($assertions->asXML()))) {
-            $retval->setError("Failure Validating the Signature of the assertion document");
-            $retval->setCode(Zend_InfoCard_Claims::RESULT_VALIDATION_FAILURE);
-            return $retval;
-        }
-
-        // The reference id should be locally scoped as far as I know
-        if($reference_id[0] == '#') {
-            $reference_id = substr($reference_id, 1);
-        } else {
-            $retval->setError("Reference of document signature does not reference the local document");
-            $retval->setCode(Zend_InfoCard_Claims::RESULT_VALIDATION_FAILURE);
-            return $retval;
-        }
-
-        // Make sure the signature is in reference to the same document as the assertions
-        if($reference_id != $assertions->getAssertionID()) {
-            $retval->setError("Reference of document signature does not reference the local document");
-            $retval->setCode(Zend_InfoCard_Claims::RESULT_VALIDATION_FAILURE);
-        }
-
-        // Validate we haven't seen this before and the conditions are acceptable
-        $conditions = $this->getAdapter()->retrieveAssertion($assertions->getAssertionURI(), $assertions->getAssertionID());
-
-        if($conditions === false) {
-            $conditions = $assertions->getConditions();
-        }
-
-
-        if(is_array($condition_error = $assertions->validateConditions($conditions))) {
-            $retval->setError("Conditions of assertion document are not met: {$condition_error[1]} ({$condition_error[0]})");
-            $retval->setCode(Zend_InfoCard_Claims::RESULT_VALIDATION_FAILURE);
-        }
-
-        $attributes = $assertions->getAttributes();
-
-        $retval->setClaims($attributes);
-
-        if($retval->getCode() == 0) {
-            $retval->setCode(Zend_InfoCard_Claims::RESULT_SUCCESS);
-        }
-
-        return $retval;
-    }
-}

+ 0 - 79
library/Zend/InfoCard/Adapter/Default.php

@@ -1,79 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Adapter
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Adapter_Interface
- */
-require_once 'Zend/InfoCard/Adapter/Interface.php';
-
-/**
- * The default InfoCard component Adapter which serves as a pass-thru placeholder
- * for developers. Initially developed to provide a callback mechanism to store and retrieve
- * assertions as part of the validation process it can be used anytime callback facilities
- * are necessary
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Adapter
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Adapter_Default implements Zend_InfoCard_Adapter_Interface
-{
-    /**
-     * Store the assertion (pass-thru does nothing)
-     *
-     * @param string $assertionURI The assertion type URI
-     * @param string $assertionID The specific assertion ID
-     * @param array $conditions An array of claims to store associated with the assertion
-     * @return bool Always returns true (would return false on store failure)
-     */
-    public function storeAssertion($assertionURI, $assertionID, $conditions)
-    {
-        return true;
-    }
-
-    /**
-     * Retrieve an assertion (pass-thru does nothing)
-     *
-     * @param string $assertionURI The assertion type URI
-     * @param string $assertionID The assertion ID to retrieve
-     * @return mixed False if the assertion ID was not found for that URI, or an array of
-     *               conditions associated with that assertion if found (always returns false)
-     */
-    public function retrieveAssertion($assertionURI, $assertionID)
-    {
-        return false;
-    }
-
-    /**
-     * Remove an assertion (pass-thru does nothing)
-     *
-     * @param string $assertionURI The assertion type URI
-     * @param string $assertionID The assertion ID to remove
-     * @return bool Always returns true (false on removal failure)
-     */
-    public function removeAssertion($assertionURI, $assertionID)
-    {
-        return null;
-    }
-}

+ 0 - 37
library/Zend/InfoCard/Adapter/Exception.php

@@ -1,37 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Adapter
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * @see Zend_InfoCard_Exception
- */
-require_once 'Zend/InfoCard/Exception.php';
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Adapter
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Adapter_Exception extends Zend_InfoCard_Exception
-{
-}

+ 0 - 64
library/Zend/InfoCard/Adapter/Interface.php

@@ -1,64 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Adapter
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * The interface required by all Zend_InfoCard Adapter classes to implement. It represents
- * a series of callback methods used by the component during processing of an information card
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Adapter
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-interface Zend_InfoCard_Adapter_Interface
-{
-    /**
-     * Store the assertion's claims in persistent storage
-     *
-     * @param string $assertionURI The assertion type URI
-     * @param string $assertionID The specific assertion ID
-     * @param array $conditions An array of claims to store associated with the assertion
-     * @return bool True on success, false on failure
-     */
-    public function storeAssertion($assertionURI, $assertionID, $conditions);
-
-    /**
-     * Retrieve the claims of a given assertion from persistent storage
-     *
-     * @param string $assertionURI The assertion type URI
-     * @param string $assertionID The assertion ID to retrieve
-     * @return mixed False if the assertion ID was not found for that URI, or an array of
-     *               conditions associated with that assertion if found in the same format
-     *                  provided
-     */
-    public function retrieveAssertion($assertionURI, $assertionID);
-
-    /**
-     * Remove the claims of a given assertion from persistent storage
-     *
-     * @param string $asserionURI The assertion type URI
-     * @param string $assertionID The assertion ID to remove
-     * @return bool True on success, false on failure
-     */
-    public function removeAssertion($asserionURI, $assertionID);
-}

+ 0 - 99
library/Zend/InfoCard/Cipher.php

@@ -1,99 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Provides an abstraction for encryption ciphers used in an Information Card
- * implementation
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Cipher
-{
-    /**
-     * AES 256 Encryption with CBC
-     */
-    const ENC_AES256CBC      = 'http://www.w3.org/2001/04/xmlenc#aes256-cbc';
-
-    /**
-     * AES 128 Encryption with CBC
-     */
-    const ENC_AES128CBC      = 'http://www.w3.org/2001/04/xmlenc#aes128-cbc';
-
-    /**
-     * RSA Public Key Encryption with OAEP Padding
-     */
-    const ENC_RSA_OAEP_MGF1P = 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p';
-
-    /**
-     * RSA Public Key Encryption with no padding
-     */
-    const ENC_RSA            = 'http://www.w3.org/2001/04/xmlenc#rsa-1_5';
-
-    /**
-     * Constructor (disabled)
-     *
-     * @return void
-     * @codeCoverageIgnoreStart
-     */
-    protected function __construct()
-    {
-    }
-    // @codeCoverageIgnoreEnd
-    /**
-     * Returns an instance of a cipher object supported based on the URI provided
-     *
-     * @throws Zend_InfoCard_Cipher_Exception
-     * @param string $uri The URI of the encryption method wantde
-     * @return mixed an Instance of Zend_InfoCard_Cipher_Symmetric_Interface or Zend_InfoCard_Cipher_Pki_Interface
-     *               depending on URI
-     */
-    static public function getInstanceByURI($uri)
-    {
-        switch($uri) {
-            case self::ENC_AES256CBC:
-                include_once 'Zend/InfoCard/Cipher/Symmetric/Adapter/Aes256cbc.php';
-                return new Zend_InfoCard_Cipher_Symmetric_Adapter_Aes256cbc();
-
-            case self::ENC_AES128CBC:
-                include_once 'Zend/InfoCard/Cipher/Symmetric/Adapter/Aes128cbc.php';
-                return new Zend_InfoCard_Cipher_Symmetric_Adapter_Aes128cbc();
-
-            case self::ENC_RSA_OAEP_MGF1P:
-                include_once 'Zend/InfoCard/Cipher/Pki/Adapter/Rsa.php';
-                return new Zend_InfoCard_Cipher_Pki_Adapter_Rsa(Zend_InfoCard_Cipher_Pki_Adapter_Rsa::OAEP_PADDING);
-                break;
-
-            case self::ENC_RSA:
-                include_once 'Zend/InfoCard/Cipher/Pki/Adapter/Rsa.php';
-                return new Zend_InfoCard_Cipher_Pki_Adapter_Rsa(Zend_InfoCard_Cipher_Pki_Adapter_Rsa::NO_PADDING);
-                break;
-
-            default:
-                require_once 'Zend/InfoCard/Cipher/Exception.php';
-                throw new Zend_InfoCard_Cipher_Exception("Unknown Cipher URI");
-        }
-    }
-}

+ 0 - 38
library/Zend/InfoCard/Cipher/Exception.php

@@ -1,38 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Exception
- */
-require_once 'Zend/InfoCard/Exception.php';
-
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Cipher_Exception extends Zend_InfoCard_Exception
-{
-}

+ 0 - 88
library/Zend/InfoCard/Cipher/Pki/Adapter/Abstract.php

@@ -1,88 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Cipher_Pki_Interface
- */
-require_once 'Zend/InfoCard/Cipher/Pki/Interface.php';
-
-/**
- * An abstract class for public-key ciphers
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-abstract class Zend_InfoCard_Cipher_Pki_Adapter_Abstract implements Zend_InfoCard_Cipher_Pki_Interface
-{
-    /**
-     * OAEP Padding public key encryption
-     */
-    const OAEP_PADDING = 1;
-
-    /**
-     * No padding public key encryption
-     */
-    const NO_PADDING = 2;
-
-    /**
-     * The type of padding to use
-     *
-     * @var integer one of the padding constants in this class
-     */
-    protected $_padding;
-
-    /**
-     * Set the padding of the public key encryption
-     *
-     * @throws Zend_InfoCard_Cipher_Exception
-     * @param integer $padding One of the constnats in this class
-     * @return Zend_InfoCard_Pki_Adapter_Abstract
-     */
-    public function setPadding($padding)
-    {
-        switch($padding) {
-            case self::OAEP_PADDING:
-            case self::NO_PADDING:
-                $this->_padding = $padding;
-                break;
-            default:
-                require_once 'Zend/InfoCard/Cipher/Exception.php';
-                throw new Zend_InfoCard_Cipher_Exception("Invalid Padding Type Provided");
-                break;
-        }
-
-        return $this;
-    }
-
-    /**
-     * Retruns the public-key padding used
-     *
-     * @return integer One of the padding constants in this class
-     */
-    public function getPadding()
-    {
-        return $this->_padding;
-    }
-}

+ 0 - 120
library/Zend/InfoCard/Cipher/Pki/Adapter/Rsa.php

@@ -1,120 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Cipher_Pki_Adapter_Abstract
- */
-require_once 'Zend/InfoCard/Cipher/Pki/Adapter/Abstract.php';
-
-/**
- * Zend_InfoCard_Cipher_Pki_Rsa_Interface
- */
-require_once 'Zend/InfoCard/Cipher/Pki/Rsa/Interface.php';
-
-/**
- * RSA Public Key Encryption Cipher Object for the InfoCard component. Relies on OpenSSL
- * to implement the RSA algorithm
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Cipher_Pki_Adapter_Rsa
-    extends Zend_InfoCard_Cipher_Pki_Adapter_Abstract
-    implements Zend_InfoCard_Cipher_Pki_Rsa_Interface
-{
-
-    /**
-     * Object Constructor
-     *
-     * @param integer $padding The type of Padding to use
-     */
-    public function __construct($padding = Zend_InfoCard_Cipher_Pki_Adapter_Abstract::NO_PADDING)
-    {
-        // Can't test this..
-        // @codeCoverageIgnoreStart
-        if(!extension_loaded('openssl')) {
-            require_once 'Zend/InfoCard/Cipher/Exception.php';
-            throw new Zend_InfoCard_Cipher_Exception("Use of this PKI RSA Adapter requires the openssl extension loaded");
-        }
-        // @codeCoverageIgnoreEnd
-
-        $this->setPadding($padding);
-    }
-
-    /**
-     * Decrypts RSA encrypted data using the given private key
-     *
-     * @throws Zend_InfoCard_Cipher_Exception
-     * @param string $encryptedData The encrypted data in binary format
-     * @param string $privateKey The private key in binary format
-     * @param string $password The private key passphrase
-     * @param integer $padding The padding to use during decryption (of not provided object value will be used)
-     * @return string The decrypted data
-     */
-    public function decrypt($encryptedData, $privateKey, $password = null, $padding = null)
-    {
-        $private_key = openssl_pkey_get_private(array($privateKey, $password));
-
-        if(!$private_key) {
-            require_once 'Zend/InfoCard/Cipher/Exception.php';
-            throw new Zend_InfoCard_Cipher_Exception("Failed to load private key");
-        }
-
-        if($padding !== null) {
-            try {
-                $this->setPadding($padding);
-            } catch(Exception $e) {
-                openssl_free_key($private_key);
-                throw $e;
-            }
-        }
-
-        switch($this->getPadding()) {
-            case self::NO_PADDING:
-                $openssl_padding = OPENSSL_NO_PADDING;
-                break;
-            case self::OAEP_PADDING:
-                $openssl_padding = OPENSSL_PKCS1_OAEP_PADDING;
-                break;
-        }
-
-        $result = openssl_private_decrypt($encryptedData, $decryptedData, $private_key, $openssl_padding);
-
-        openssl_free_key($private_key);
-
-        if(!$result) {
-            require_once 'Zend/InfoCard/Cipher/Exception.php';
-            throw new Zend_InfoCard_Cipher_Exception("Unable to Decrypt Value using provided private key");
-        }
-
-        if($this->getPadding() == self::NO_PADDING) {
-            $decryptedData = substr($decryptedData, 2);
-            $start = strpos($decryptedData, 0) + 1;
-            $decryptedData = substr($decryptedData, $start);
-        }
-
-        return $decryptedData;
-    }
-}

+ 0 - 33
library/Zend/InfoCard/Cipher/Pki/Interface.php

@@ -1,33 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Empty Interface represents a Pki cipher object
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-interface Zend_InfoCard_Cipher_Pki_Interface
-{
-}

+ 0 - 50
library/Zend/InfoCard/Cipher/Pki/Rsa/Interface.php

@@ -1,50 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Cipher_PKI_Adapter_Abstract
- */
-require_once 'Zend/InfoCard/Cipher/Pki/Adapter/Abstract.php';
-
-/**
- * The interface which defines the RSA Public-key encryption object
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-interface Zend_InfoCard_Cipher_Pki_Rsa_Interface
-{
-    /**
-     * Decrypts RSA encrypted data using the given private key
-     *
-     * @throws Zend_InfoCard_Cipher_Exception
-     * @param string $encryptedData The encrypted data in binary format
-     * @param string $privateKey The private key in binary format
-     * @param string $password The private key passphrase
-     * @param integer $padding The padding to use during decryption (of not provided object value will be used)
-     * @return string The decrypted data
-     */
-    public function decrypt($encryptedData, $privateKey, $password = null, $padding = Zend_InfoCard_Cipher_Pki_Adapter_Abstract::NO_PADDING);
-}

+ 0 - 38
library/Zend/InfoCard/Cipher/Symmetric/Adapter/Abstract.php

@@ -1,38 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Cipher_Symmetric_Interface
- */
-require_once 'Zend/InfoCard/Cipher/Symmetric/Interface.php';
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-abstract class Zend_InfoCard_Cipher_Symmetric_Adapter_Abstract
-    implements Zend_InfoCard_Cipher_Symmetric_Interface
-{
-}

+ 0 - 40
library/Zend/InfoCard/Cipher/Symmetric/Adapter/Aes128cbc.php

@@ -1,40 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Cipher_Symmetric_Adapter_Aes256cbc
- */
-require_once 'Zend/InfoCard/Cipher/Symmetric/Adapter/Aes256cbc.php';
-
-/**
- * Implements AES128 with CBC encryption implemented using the mCrypt extension
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Cipher_Symmetric_Adapter_Aes128cbc
-    extends Zend_InfoCard_Cipher_Symmetric_Adapter_Aes256cbc
-{
-}

+ 0 - 111
library/Zend/InfoCard/Cipher/Symmetric/Adapter/Aes256cbc.php

@@ -1,111 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Cipher_Symmetric_Adapter_Abstract
- */
-require_once 'Zend/InfoCard/Cipher/Symmetric/Adapter/Abstract.php';
-
-/**
- * Zend_InfoCard_Cipher_Symmetric_Aes256cbc_Interface
- */
-require_once 'Zend/InfoCard/Cipher/Symmetric/Aes256cbc/Interface.php';
-
-/**
- * Implements AES256 with CBC encryption implemented using the mCrypt extension
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Cipher_Symmetric_Adapter_Aes256cbc
-    extends Zend_InfoCard_Cipher_Symmetric_Adapter_Abstract
-    implements Zend_InfoCard_Cipher_Symmetric_Aes256cbc_Interface
-{
-    /**
-     * The MCRYPT Cipher constant for this encryption
-     */
-    const MCRYPT_CIPHER = MCRYPT_RIJNDAEL_128;
-
-    /**
-     * The MCRYPT Mode constant for this encryption
-     */
-    const MCRYPT_MODE   = MCRYPT_MODE_CBC;
-
-    /**
-     * The default length of the IV to use
-     */
-    const IV_LENGTH     = 16;
-
-    /**
-     * The object constructor
-     *
-     * @throws Zend_InfoCard_Cipher_Exception
-     */
-    public function __construct()
-    {
-        // Can't test for this
-        // @codeCoverageIgnoreStart
-        if(!extension_loaded('mcrypt')) {
-            require_once 'Zend/InfoCard/Cipher/Exception.php';
-            throw new Zend_InfoCard_Cipher_Exception("Use of the AES256CBC Cipher requires the mcrypt extension");
-        }
-        // @codeCoveregIgnoreEnd
-    }
-
-    /**
-     * Decrypts data using the AES Algorithm using the mCrypt extension
-     *
-     * @throws Zend_InfoCard_Cipher_Exception
-     * @param string $encryptedData The encrypted data in binary format
-     * @param string $decryptionKey The decryption key
-     * @param integer $iv_length The IV length to use
-     * @return string the decrypted data with any terminating nulls removed
-     */
-    public function decrypt($encryptedData, $decryptionKey, $iv_length = null)
-    {
-
-        $iv_length = ($iv_length === null) ? self::IV_LENGTH : $iv_length;
-
-        $mcrypt_iv = null;
-
-        if($iv_length > 0) {
-             $mcrypt_iv = substr($encryptedData, 0, $iv_length);
-            $encryptedData = substr($encryptedData, $iv_length);
-        }
-
-        $decrypted = mcrypt_decrypt(self::MCRYPT_CIPHER, $decryptionKey, $encryptedData, self::MCRYPT_MODE, $mcrypt_iv);
-
-        if(!$decrypted) {
-            require_once 'Zend/InfoCard/Cipher/Exception.php';
-            throw new Zend_InfoCard_Cipher_Exception("Failed to decrypt data using AES256CBC Algorithm");
-        }
-
-        $decryptedLength = strlen($decrypted);
-        $paddingLength = substr($decrypted, $decryptedLength -1, 1);
-        $decrypted = substr($decrypted, 0, $decryptedLength - ord($paddingLength));
-
-        return rtrim($decrypted, "\0");
-    }
-}

+ 0 - 38
library/Zend/InfoCard/Cipher/Symmetric/Aes128cbc/Interface.php

@@ -1,38 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Cipher_Symmetric_Aes256cbc_Interface
- */
-require_once 'Zend/InfoCard/Cipher/Symmetric/Aes256cbc/Interface.php';
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-interface Zend_InfoCard_Cipher_Symmetric_Aes128cbc_Interface
-    extends Zend_InfoCard_Cipher_Symmetric_Aes256cbc_Interface
-{
-}

+ 0 - 33
library/Zend/InfoCard/Cipher/Symmetric/Aes256cbc/Interface.php

@@ -1,33 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-interface Zend_InfoCard_Cipher_Symmetric_Aes256cbc_Interface
-{
-    public function decrypt($encryptedData, $decryptionKey, $iv_length = null);
-}

+ 0 - 32
library/Zend/InfoCard/Cipher/Symmetric/Interface.php

@@ -1,32 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Cipher
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-interface Zend_InfoCard_Cipher_Symmetric_Interface
-{
-}

+ 0 - 307
library/Zend/InfoCard/Claims.php

@@ -1,307 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Result value of the InfoCard component, contains any error messages and claims
- * from the processing of an information card.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Claims
-{
-    /**
-     * Successful validation and extraion of claims
-     */
-    const RESULT_SUCCESS = 1;
-
-    /**
-     * Indicates there was an error processing the XML document
-     */
-    const RESULT_PROCESSING_FAILURE = 2;
-
-    /**
-     * Indicates that the signature values within the XML document failed verification
-     */
-    const RESULT_VALIDATION_FAILURE = 3;
-
-    /**
-     * The default namespace to assume in these claims
-     *
-     * @var string
-     */
-    protected $_defaultNamespace  = null;
-
-    /**
-     * A boolean indicating if the claims should be consider "valid" or not based on processing
-     *
-     * @var bool
-     */
-    protected $_isValid = true;
-
-    /**
-     * The error message if any
-     *
-     * @var string
-     */
-    protected $_error = "";
-
-    /**
-     * An array of claims taken from the information card
-     *
-     * @var array
-     */
-    protected $_claims;
-
-    /**
-     * The result code of processing the information card as defined by the constants of this class
-     *
-     * @var integer
-     */
-    protected $_code;
-
-    /**
-     * Override for the safeguard which ensures that you don't use claims which failed validation.
-     * Used in situations when there was a validation error you'd like to ignore
-     *
-     * @return Zend_InfoCard_Claims
-     */
-    public function forceValid()
-    {
-        trigger_error("Forcing Claims to be valid although it is a security risk", E_USER_WARNING);
-        $this->_isValid = true;
-        return $this;
-    }
-
-    /**
-     * Retrieve the PPI (Private Personal Identifier) associated with the information card
-     *
-     * @return string the private personal identifier
-     */
-    public function getCardID()
-    {
-        return $this->getClaim('http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier');
-    }
-
-    /**
-     * Retrieves the default namespace used in this information card. If a default namespace was not
-     * set, it figures out which one to consider 'default' by taking the first namespace sorted by use-count
-     * in claims
-     *
-     * @throws Zend_InfoCard_Exception
-     * @return string The default namespace
-     */
-    public function getDefaultNamespace()
-    {
-        if($this->_defaultNamespace === null) {
-            $namespaces = array();
-            $leader = '';
-            foreach($this->_claims as $claim) {
-                if(!isset($namespaces[$claim['namespace']])) {
-                    $namespaces[$claim['namespace']] = 1;
-                } else {
-                    $namespaces[$claim['namespace']]++;
-                }
-
-                if(empty($leader) || ($namespaces[$claim['namespace']] > $leader)) {
-                    $leader = $claim['namespace'];
-                }
-            }
-
-            if(empty($leader)) {
-                require_once 'Zend/InfoCard/Exception.php';
-                throw new Zend_InfoCard_Exception("Failed to determine default namespace");
-            }
-
-            $this->setDefaultNamespace($leader);
-        }
-
-        return $this->_defaultNamespace;
-    }
-
-    /**
-     * Set the default namespace, overriding any existing default
-     *
-     * @throws Zend_InfoCard_Exception
-     * @param string $namespace The default namespace to use
-     * @return Zend_InfoCard_Claims
-     */
-    public function setDefaultNamespace($namespace)
-    {
-
-        foreach($this->_claims as $claim) {
-            if($namespace == $claim['namespace']) {
-                $this->_defaultNamespace = $namespace;
-                return $this;
-            }
-        }
-
-        require_once 'Zend/InfoCard/Exception.php';
-        throw new Zend_InfoCard_Exception("At least one claim must exist in specified namespace to make it the default namespace");
-    }
-
-    /**
-     * Indicates if this claim object contains validated claims or not
-     *
-     * @return bool
-     */
-    public function isValid()
-    {
-        return $this->_isValid;
-    }
-
-    /**
-     * Set the error message contained within the claims object
-     *
-     * @param string $error The error message
-     * @return Zend_InfoCard_Claims
-     */
-    public function setError($error)
-    {
-        $this->_error = $error;
-        $this->_isValid = false;
-        return $this;
-    }
-
-    /**
-     * Retrieve the error message contained within the claims object
-     *
-     * @return string The error message
-     */
-    public function getErrorMsg()
-    {
-        return $this->_error;
-    }
-
-    /**
-     * Set the claims for the claims object. Can only be set once and is done
-     * by the component itself. Internal use only.
-     *
-     * @throws Zend_InfoCard_Exception
-     * @param array $claims
-     * @return Zend_InfoCard_Claims
-     */
-    public function setClaims(Array $claims)
-    {
-        if($this->_claims !== null) {
-            require_once 'Zend/InfoCard/Exception.php';
-            throw new Zend_InfoCard_Exception("Claim objects are read-only");
-        }
-
-        $this->_claims = $claims;
-        return $this;
-    }
-
-    /**
-     * Set the result code of the claims object.
-     *
-     * @throws Zend_InfoCard_Exception
-     * @param int $code The result code
-     * @return Zend_InfoCard_Claims
-     */
-    public function setCode($code)
-    {
-        switch($code) {
-            case self::RESULT_PROCESSING_FAILURE:
-            case self::RESULT_SUCCESS:
-            case self::RESULT_VALIDATION_FAILURE:
-                $this->_code = $code;
-                return $this;
-        }
-
-        require_once 'Zend/InfoCard/Exception.php';
-        throw new Zend_InfoCard_Exception("Attempted to set unknown error code");
-    }
-
-    /**
-     * Gets the result code of the claims object
-     *
-     * @return integer The result code
-     */
-    public function getCode()
-    {
-        return $this->_code;
-    }
-
-    /**
-     * Get a claim by providing its complete claim URI
-     *
-     * @param string $claimURI The complete claim URI to retrieve
-     * @return mixed The claim matching that specific URI or null if not found
-     */
-    public function getClaim($claimURI)
-    {
-        if($this->claimExists($claimURI)) {
-            return $this->_claims[$claimURI]['value'];
-        }
-
-        return null;
-    }
-
-    /**
-     * Indicates if a specific claim URI exists or not within the object
-     *
-     * @param string $claimURI The complete claim URI to check
-     * @return bool true if the claim exists, false if not found
-     */
-    public function claimExists($claimURI)
-    {
-        return isset($this->_claims[$claimURI]);
-    }
-
-    /**
-     * Magic helper function
-     * @throws Zend_InfoCard_Exception
-     */
-    public function __unset($k)
-    {
-        require_once 'Zend/InfoCard/Exception.php';
-        throw new Zend_InfoCard_Exception("Claim objects are read-only");
-    }
-
-    /**
-     * Magic helper function
-     */
-    public function __isset($k)
-    {
-        return $this->claimExists("{$this->getDefaultNamespace()}/$k");
-    }
-
-    /**
-     * Magic helper function
-     */
-    public function __get($k)
-    {
-        return $this->getClaim("{$this->getDefaultNamespace()}/$k");
-    }
-
-    /**
-     * Magic helper function
-     * @throws Zend_InfoCard_Exception
-     */
-    public function __set($k, $v)
-    {
-        require_once 'Zend/InfoCard/Exception.php';
-        throw new Zend_InfoCard_Exception("Claim objects are read-only");
-    }
-}

+ 0 - 43
library/Zend/InfoCard/Exception.php

@@ -1,43 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-if (class_exists("Zend_Exception")) {
-    abstract class Zend_InfoCard_Exception_Abstract extends Zend_Exception
-    {
-    }
-} else {
-    abstract class Zend_InfoCard_Exception_Abstract extends Exception
-    {
-    }
-}
-
-/**
- * Base Exception class for the InfoCard component
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Exception extends Zend_InfoCard_Exception_Abstract
-{
-}

+ 0 - 88
library/Zend/InfoCard/Xml/Assertion.php

@@ -1,88 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_Assertion_Interface
- */
-require_once 'Zend/InfoCard/Xml/Assertion/Interface.php';
-
-/**
- * Factory object to retrieve an Assertion object based on the type of XML document provided
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-final class Zend_InfoCard_Xml_Assertion
-{
-    /**
-     * The namespace for a SAML-formatted Assertion document
-     */
-    const TYPE_SAML = 'urn:oasis:names:tc:SAML:1.0:assertion';
-
-    /**
-     * Constructor (disabled)
-     *
-     * @return void
-     */
-    private function __construct()
-    {
-    }
-
-    /**
-     * Returns an instance of a InfoCard Assertion object based on the XML data provided
-     *
-     * @throws Zend_InfoCard_Xml_Exception
-     * @param string $xmlData The XML-Formatted Assertion
-     * @return Zend_InfoCard_Xml_Assertion_Interface
-     * @throws Zend_InfoCard_Xml_Exception
-     */
-    static public function getInstance($xmlData)
-    {
-
-        if($xmlData instanceof Zend_InfoCard_Xml_Element) {
-            $strXmlData = $xmlData->asXML();
-        } else if (is_string($xmlData)) {
-            $strXmlData = $xmlData;
-        } else {
-            require_once 'Zend/InfoCard/Xml/Exception.php';
-            throw new Zend_InfoCard_Xml_Exception("Invalid Data provided to create instance");
-        }
-
-        $sxe = simplexml_load_string($strXmlData);
-
-        $namespaces = $sxe->getDocNameSpaces();
-
-        foreach($namespaces as $namespace) {
-            switch($namespace) {
-                case self::TYPE_SAML:
-                    include_once 'Zend/InfoCard/Xml/Assertion/Saml.php';
-                    return simplexml_load_string($strXmlData, 'Zend_InfoCard_Xml_Assertion_Saml', null);
-            }
-        }
-
-        require_once 'Zend/InfoCard/Xml/Exception.php';
-        throw new Zend_InfoCard_Xml_Exception("Unable to determine Assertion type by Namespace");
-    }
-}

+ 0 - 69
library/Zend/InfoCard/Xml/Assertion/Interface.php

@@ -1,69 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * The Interface required by any InfoCard Assertion Object implemented within the component
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-interface Zend_InfoCard_Xml_Assertion_Interface
-{
-    /**
-     * Get the Assertion ID of the assertion
-     *
-     * @return string The Assertion ID
-     */
-    public function getAssertionID();
-
-    /**
-     * Return an array of attributes (claims) contained within the assertion
-     *
-     * @return array An array of attributes / claims within the assertion
-     */
-    public function getAttributes();
-
-    /**
-     * Get the Assertion URI for this type of Assertion
-     *
-     * @return string the Assertion URI
-     */
-    public function getAssertionURI();
-
-    /**
-     * Return an array of conditions which the assertions are predicated on
-     *
-     * @return array an array of conditions
-     */
-    public function getConditions();
-
-    /**
-     * Validate the conditions array returned from the getConditions() call
-     *
-     * @param array $conditions An array of condtions for the assertion taken from getConditions()
-     * @return mixed Boolean true on success, an array of condition, error message on failure
-     */
-    public function validateConditions(Array $conditions);
-}

+ 0 - 284
library/Zend/InfoCard/Xml/Assertion/Saml.php

@@ -1,284 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_Element
- */
-require_once 'Zend/InfoCard/Xml/Element.php';
-
-/**
- * Zend_InfoCard_Xml_Assertion_Interface
- */
-require_once 'Zend/InfoCard/Xml/Assertion/Interface.php';
-
-/**
- * A Xml Assertion Document in SAML Token format
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Xml_Assertion_Saml
-    extends Zend_InfoCard_Xml_Element
-    implements Zend_InfoCard_Xml_Assertion_Interface
-{
-
-    /**
-     * Audience Restriction Condition
-     */
-    const CONDITION_AUDIENCE = 'AudienceRestrictionCondition';
-
-    /**
-     * The URI for a 'bearer' confirmation
-     */
-    const CONFIRMATION_BEARER = 'urn:oasis:names:tc:SAML:1.0:cm:bearer';
-
-    /**
-     * The amount of time in seconds to buffer when checking conditions to ensure
-     * that differences between client/server clocks don't interfer too much
-     */
-    const CONDITION_TIME_ADJ = 3600; // +- 5 minutes
-
-    protected function _getServerName() {
-        return $_SERVER['SERVER_NAME'];
-    }
-
-    protected function _getServerPort() {
-        return $_SERVER['SERVER_PORT'];
-    }
-
-    /**
-     * Validate the conditions array returned from the getConditions() call
-     *
-     * @param array $conditions An array of condtions for the assertion taken from getConditions()
-     * @return mixed Boolean true on success, an array of condition, error message on failure
-     */
-    public function validateConditions(Array $conditions)
-    {
-
-        $currentTime = time();
-
-        if(!empty($conditions)) {
-
-            foreach($conditions as $condition => $conditionValue) {
-                switch(strtolower($condition)) {
-                    case 'audiencerestrictioncondition':
-
-                        $serverName = $this->_getServerName();
-                        $serverPort = $this->_getServerPort();
-
-                        $self_aliases[] = $serverName;
-                        $self_aliases[] = "{{$serverName}:{$serverPort}";
-
-                        $found = false;
-                        if(is_array($conditionValue)) {
-                            foreach($conditionValue as $audience) {
-
-                                list(,,$audience) = explode('/', $audience);
-                                if(in_array($audience, $self_aliases)) {
-                                    $found = true;
-                                    break;
-                                }
-                            }
-                        }
-
-                        if(!$found) {
-                            return array($condition, 'Could not find self in allowed audience list');
-                        }
-
-                        break;
-                    case 'notbefore':
-                        $notbeforetime = strtotime($conditionValue);
-
-                        if($currentTime < $notbeforetime) {
-                            if($currentTime + self::CONDITION_TIME_ADJ < $notbeforetime) {
-                                return array($condition, 'Current time is before specified window');
-                            }
-                        }
-
-                        break;
-                    case 'notonorafter':
-                        $notonoraftertime = strtotime($conditionValue);
-
-                        if($currentTime >= $notonoraftertime) {
-                            if($currentTime - self::CONDITION_TIME_ADJ >= $notonoraftertime) {
-                                return array($condition, 'Current time is after specified window');
-                            }
-                        }
-
-                        break;
-
-                }
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Get the Assertion URI for this type of Assertion
-     *
-     * @return string the Assertion URI
-     */
-    public function getAssertionURI()
-    {
-        return Zend_InfoCard_Xml_Assertion::TYPE_SAML;
-    }
-
-    /**
-     * Get the Major Version of the SAML Assertion
-     *
-     * @return integer The major version number
-     */
-    public function getMajorVersion()
-    {
-        return (int)(string)$this['MajorVersion'];
-    }
-
-    /**
-     * The Minor Version of the SAML Assertion
-     *
-     * @return integer The minor version number
-     */
-    public function getMinorVersion()
-    {
-        return (int)(string)$this['MinorVersion'];
-    }
-
-    /**
-     * Get the Assertion ID of the assertion
-     *
-     * @return string The Assertion ID
-     */
-    public function getAssertionID()
-    {
-        return (string)$this['AssertionID'];
-    }
-
-    /**
-     * Get the Issuer URI of the assertion
-     *
-     * @return string the URI of the assertion Issuer
-     */
-    public function getIssuer()
-    {
-        return (string)$this['Issuer'];
-    }
-
-    /**
-     * Get the Timestamp of when the assertion was issued
-     *
-     * @return integer a UNIX timestamp representing when the assertion was issued
-     */
-    public function getIssuedTimestamp()
-    {
-        return strtotime((string)$this['IssueInstant']);
-    }
-
-    /**
-     * Return an array of conditions which the assertions are predicated on
-     *
-     * @throws Zend_InfoCard_Xml_Exception
-     * @return array an array of conditions
-     */
-    public function getConditions()
-    {
-
-        list($conditions) = $this->xpath("//saml:Conditions");
-
-        if(!($conditions instanceof Zend_InfoCard_Xml_Element)) {
-            throw new Zend_InfoCard_Xml_Exception("Unable to find the saml:Conditions block");
-        }
-
-        $retval = array();
-
-        foreach($conditions->children('urn:oasis:names:tc:SAML:1.0:assertion') as $key => $value) {
-            switch($key) {
-                case self::CONDITION_AUDIENCE:
-                    foreach($value->children('urn:oasis:names:tc:SAML:1.0:assertion') as $audience_key => $audience_value) {
-                        if($audience_key == 'Audience') {
-                            $retval[$key][] = (string)$audience_value;
-                        }
-                    }
-                    break;
-            }
-        }
-
-        $retval['NotBefore'] = (string)$conditions['NotBefore'];
-        $retval['NotOnOrAfter'] = (string)$conditions['NotOnOrAfter'];
-
-        return $retval;
-    }
-
-    /**
-     * Get they KeyInfo element for the Subject KeyInfo block
-     *
-     * @todo Not Yet Implemented
-     * @ignore
-     */
-    public function getSubjectKeyInfo()
-    {
-        /**
-         * @todo Not sure if this is part of the scope for now..
-         */
-
-        if($this->getConfirmationMethod() == self::CONFIRMATION_BEARER) {
-            throw new Zend_InfoCard_Xml_Exception("Cannot get Subject Key Info when Confirmation Method was Bearer");
-        }
-    }
-
-    /**
-     * Return the Confirmation Method URI used in the Assertion
-     *
-     * @return string The confirmation method URI
-     */
-    public function getConfirmationMethod()
-    {
-        list($confirmation) = $this->xPath("//saml:ConfirmationMethod");
-        return (string)$confirmation;
-    }
-
-    /**
-     * Return an array of attributes (claims) contained within the assertion
-     *
-     * @return array An array of attributes / claims within the assertion
-     */
-    public function getAttributes()
-    {
-        $attributes = $this->xPath('//saml:Attribute');
-
-        $retval = array();
-        foreach($attributes as $key => $value) {
-
-            $retkey = (string)$value['AttributeNamespace'].'/'.(string)$value['AttributeName'];
-
-            $retval[$retkey]['name'] = (string)$value['AttributeName'];
-            $retval[$retkey]['namespace'] = (string)$value['AttributeNamespace'];
-
-            list($aValue) = $value->children('urn:oasis:names:tc:SAML:1.0:assertion');
-            $retval[$retkey]['value'] = (string)$aValue;
-        }
-
-        return $retval;
-    }
-}

+ 0 - 107
library/Zend/InfoCard/Xml/Element.php

@@ -1,107 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_Element_Interface
- */
-require_once 'Zend/InfoCard/Xml/Element/Interface.php';
-
-/**
- * An abstract class representing a an XML data block
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-abstract class Zend_InfoCard_Xml_Element
-    extends SimpleXMLElement
-    implements Zend_InfoCard_Xml_Element_Interface
-{
-    /**
-     * Convert the object to a string by displaying its XML content
-     *
-     * @return string an XML representation of the object
-     */
-    public function __toString()
-    {
-        return $this->asXML();
-    }
-
-    /**
-     * Converts an XML Element object into a DOM object
-     *
-     * @throws Zend_InfoCard_Xml_Exception
-     * @param Zend_InfoCard_Xml_Element $e The object to convert
-     * @return DOMElement A DOMElement representation of the same object
-     */
-    static public function convertToDOM(Zend_InfoCard_Xml_Element $e)
-    {
-        $dom = dom_import_simplexml($e);
-
-        if(!($dom instanceof DOMElement)) {
-            // Zend_InfoCard_Xml_Element exntes SimpleXMLElement, so this should *never* fail
-            // @codeCoverageIgnoreStart
-            require_once 'Zend/InfoCard/Xml/Exception.php';
-            throw new Zend_InfoCard_Xml_Exception("Failed to convert between SimpleXML and DOM");
-            // @codeCoverageIgnoreEnd
-        }
-
-        return $dom;
-    }
-
-    /**
-     * Converts a DOMElement object into the specific class
-     *
-     * @throws Zend_InfoCard_Xml_Exception
-     * @param DOMElement $e The DOMElement object to convert
-     * @param string $classname The name of the class to convert it to (must inhert from Zend_InfoCard_Xml_Element)
-     * @return Zend_InfoCard_Xml_Element a Xml Element object from the DOM element
-     */
-    static public function convertToObject(DOMElement $e, $classname)
-    {
-        if (!class_exists($classname)) {
-            require_once 'Zend/Loader.php';
-            Zend_Loader::loadClass($classname);
-        }
-
-        $reflection = new ReflectionClass($classname);
-
-        if(!$reflection->isSubclassOf('Zend_InfoCard_Xml_Element')) {
-            require_once 'Zend/InfoCard/Xml/Exception.php';
-            throw new Zend_InfoCard_Xml_Exception("DOM element must be converted to an instance of Zend_InfoCard_Xml_Element");
-        }
-
-        $sxe = simplexml_import_dom($e, $classname);
-
-        if(!($sxe instanceof Zend_InfoCard_Xml_Element)) {
-            // Since we just checked to see if this was a subclass of Zend_infoCard_Xml_Element this shoudl never fail
-            // @codeCoverageIgnoreStart
-            require_once 'Zend/InfoCard/Xml/Exception.php';
-            throw new Zend_InfoCard_Xml_Exception("Failed to convert between DOM and SimpleXML");
-            // @codeCoverageIgnoreEnd
-        }
-
-        return $sxe;
-    }
-}

+ 0 - 44
library/Zend/InfoCard/Xml/Element/Interface.php

@@ -1,44 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * The Interface used to represent an XML Data Type
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-interface Zend_InfoCard_Xml_Element_Interface
-{
-    /**
-     * Return the data within the object as an XML document
-     */
-    public function asXML();
-
-    /**
-     * Magic function which allows us to treat the object as a string to return XML
-     * (same as the asXML() method)
-     */
-    public function __toString();
-}

+ 0 - 75
library/Zend/InfoCard/Xml/EncryptedData.php

@@ -1,75 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * A factory class for producing Zend_InfoCard_Xml_EncryptedData objects based on
- * the type of XML document provided
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-final class Zend_InfoCard_Xml_EncryptedData
-{
-    /**
-     * Constructor (disabled)
-     *
-     * @return void
-     */
-    private function __construct()
-    {
-    }
-
-    /**
-     * Returns an instance of the class
-     *
-     * @param string $xmlData The XML EncryptedData String
-     * @return Zend_InfoCard_Xml_EncryptedData_Abstract
-     * @throws Zend_InfoCard_Xml_Exception
-     */
-    static public function getInstance($xmlData)
-    {
-
-        if($xmlData instanceof Zend_InfoCard_Xml_Element) {
-            $strXmlData = $xmlData->asXML();
-        } else if (is_string($xmlData)) {
-            $strXmlData = $xmlData;
-        } else {
-            require_once 'Zend/InfoCard/Xml/Exception.php';
-            throw new Zend_InfoCard_Xml_Exception("Invalid Data provided to create instance");
-        }
-
-        $sxe = simplexml_load_string($strXmlData);
-
-        switch($sxe['Type']) {
-            case 'http://www.w3.org/2001/04/xmlenc#Element':
-                include_once 'Zend/InfoCard/Xml/EncryptedData/XmlEnc.php';
-                return simplexml_load_string($strXmlData, 'Zend_InfoCard_Xml_EncryptedData_XmlEnc');
-            default:
-                require_once 'Zend/InfoCard/Xml/Exception.php';
-                throw new Zend_InfoCard_Xml_Exception("Unknown EncryptedData type found");
-                break;
-        }
-    }
-}

+ 0 - 92
library/Zend/InfoCard/Xml/EncryptedData/Abstract.php

@@ -1,92 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_Element
- */
-require_once 'Zend/InfoCard/Xml/Element.php';
-
-/**
- * Zend_InfoCard_Xml_KeyInfo
- */
-require_once 'Zend/InfoCard/Xml/KeyInfo.php';
-
-/**
- * An abstract class representing a generic EncryptedData XML block. This class is extended
- * into a specific type of EncryptedData XML block (i.e. XmlEnc) as necessary
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-abstract class Zend_InfoCard_Xml_EncryptedData_Abstract extends Zend_InfoCard_Xml_Element
-{
-
-    /**
-     * Returns the KeyInfo Block
-     *
-     * @return Zend_InfoCard_Xml_KeyInfo_Abstract
-     */
-    public function getKeyInfo()
-    {
-        return Zend_InfoCard_Xml_KeyInfo::getInstance($this->KeyInfo[0]);
-    }
-
-    /**
-     * Return the Encryption method used to encrypt the assertion document
-     * (the symmetric cipher)
-     *
-     * @throws Zend_InfoCard_Xml_Exception
-     * @return string The URI of the Symmetric Encryption Method used
-     */
-    public function getEncryptionMethod()
-    {
-
-        /**
-         * @todo This is pretty hacky unless we can always be confident that the first
-         * EncryptionMethod block is the correct one (the AES or compariable symetric algorithm)..
-         * the second is the PK method if provided.
-         */
-        list($encryption_method) = $this->xpath("//enc:EncryptionMethod");
-
-        if(!($encryption_method instanceof Zend_InfoCard_Xml_Element)) {
-            throw new Zend_InfoCard_Xml_Exception("Unable to find the enc:EncryptionMethod symmetric encryption block");
-        }
-
-        $dom = self::convertToDOM($encryption_method);
-
-        if(!$dom->hasAttribute('Algorithm')) {
-            throw new Zend_InfoCard_Xml_Exception("Unable to determine the encryption algorithm in the Symmetric enc:EncryptionMethod XML block");
-        }
-
-        return $dom->getAttribute('Algorithm');
-    }
-
-    /**
-     * Returns the value of the encrypted block
-     *
-     * @return string the value of the encrypted CipherValue block
-     */
-    abstract function getCipherValue();
-}

+ 0 - 64
library/Zend/InfoCard/Xml/EncryptedData/XmlEnc.php

@@ -1,64 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_EncryptedData/Abstract.php
- */
-require_once 'Zend/InfoCard/Xml/EncryptedData/Abstract.php';
-
-/**
- * An XmlEnc formatted EncryptedData XML block
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Xml_EncryptedData_XmlEnc extends Zend_InfoCard_Xml_EncryptedData_Abstract
-{
-
-    /**
-     * Returns the Encrypted CipherValue block from the EncryptedData XML document
-     *
-     * @throws Zend_InfoCard_Xml_Exception
-     * @return string The value of the CipherValue block base64 encoded
-     */
-    public function getCipherValue()
-    {
-        $this->registerXPathNamespace('enc', 'http://www.w3.org/2001/04/xmlenc#');
-
-        list(,$cipherdata) = $this->xpath("//enc:CipherData");
-
-        if(!($cipherdata instanceof Zend_InfoCard_Xml_Element)) {
-            throw new Zend_InfoCard_Xml_Exception("Unable to find the enc:CipherData block");
-        }
-        $cipherdata->registerXPathNamespace('enc', 'http://www.w3.org/2001/04/xmlenc#');
-        list(,$ciphervalue) = $cipherdata->xpath("//enc:CipherValue");
-
-        if(!($ciphervalue instanceof Zend_InfoCard_Xml_Element)) {
-            throw new Zend_InfoCard_Xml_Exception("Unable to fidn the enc:CipherValue block");
-        }
-
-        return (string)$ciphervalue;
-    }
-}

+ 0 - 174
library/Zend/InfoCard/Xml/EncryptedKey.php

@@ -1,174 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_Element
- */
-require_once 'Zend/InfoCard/Xml/Element.php';
-
-/**
- * Zend_InfoCard_Xml_EncryptedKey
- */
-require_once 'Zend/InfoCard/Xml/EncryptedKey.php';
-
-/**
- * Zend_InfoCard_Xml_KeyInfo_Interface
- */
-require_once 'Zend/InfoCard/Xml/KeyInfo/Interface.php';
-
-/**
- * An object representing an Xml EncryptedKEy block
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Xml_EncryptedKey
-    extends Zend_InfoCard_Xml_Element
-    implements Zend_InfoCard_Xml_KeyInfo_Interface
-{
-    /**
-     * Return an instance of the object based on input XML Data
-     *
-     * @throws Zend_InfoCard_Xml_Exception
-     * @param string $xmlData The EncryptedKey XML Block
-     * @return Zend_InfoCard_Xml_EncryptedKey
-     */
-    static public function getInstance($xmlData)
-    {
-        if($xmlData instanceof Zend_InfoCard_Xml_Element) {
-            $strXmlData = $xmlData->asXML();
-        } else if (is_string($xmlData)) {
-            $strXmlData = $xmlData;
-        } else {
-            throw new Zend_InfoCard_Xml_Exception("Invalid Data provided to create instance");
-        }
-
-        $sxe = simplexml_load_string($strXmlData);
-
-        if($sxe->getName() != "EncryptedKey") {
-            throw new Zend_InfoCard_Xml_Exception("Invalid XML Block provided for EncryptedKey");
-        }
-
-        return simplexml_load_string($strXmlData, "Zend_InfoCard_Xml_EncryptedKey");
-    }
-
-    /**
-     * Returns the Encyption Method Algorithm URI of the block
-     *
-     * @throws Zend_InfoCard_Xml_Exception
-     * @return string the Encryption method algorithm URI
-     */
-    public function getEncryptionMethod()
-    {
-
-        $this->registerXPathNamespace('e', 'http://www.w3.org/2001/04/xmlenc#');
-        list($encryption_method) = $this->xpath("//e:EncryptionMethod");
-
-        if(!($encryption_method instanceof Zend_InfoCard_Xml_Element)) {
-            throw new Zend_InfoCard_Xml_Exception("Unable to find the e:EncryptionMethod KeyInfo encryption block");
-        }
-
-        $dom = self::convertToDOM($encryption_method);
-
-        if(!$dom->hasAttribute('Algorithm')) {
-            throw new Zend_InfoCard_Xml_Exception("Unable to determine the encryption algorithm in the Symmetric enc:EncryptionMethod XML block");
-        }
-
-        return $dom->getAttribute('Algorithm');
-
-    }
-
-    /**
-     * Returns the Digest Method Algorithm URI used
-     *
-     * @throws Zend_InfoCard_Xml_Exception
-     * @return string the Digest Method Algorithm URI
-     */
-    public function getDigestMethod()
-    {
-        $this->registerXPathNamespace('e', 'http://www.w3.org/2001/04/xmlenc#');
-        list($encryption_method) = $this->xpath("//e:EncryptionMethod");
-
-        if(!($encryption_method instanceof Zend_InfoCard_Xml_Element)) {
-            throw new Zend_InfoCard_Xml_Exception("Unable to find the e:EncryptionMethod KeyInfo encryption block");
-        }
-
-        if(!($encryption_method->DigestMethod instanceof Zend_InfoCard_Xml_Element)) {
-            throw new Zend_InfoCard_Xml_Exception("Unable to find the DigestMethod block");
-        }
-
-        $dom = self::convertToDOM($encryption_method->DigestMethod);
-
-        if(!$dom->hasAttribute('Algorithm')) {
-            throw new Zend_InfoCard_Xml_Exception("Unable to determine the digest algorithm for the symmetric Keyinfo");
-        }
-
-        return $dom->getAttribute('Algorithm');
-
-    }
-
-    /**
-     * Returns the KeyInfo block object
-     *
-     * @throws Zend_InfoCard_Xml_Exception
-     * @return Zend_InfoCard_Xml_KeyInfo_Abstract
-     */
-    public function getKeyInfo()
-    {
-
-        if(isset($this->KeyInfo)) {
-            return Zend_InfoCard_Xml_KeyInfo::getInstance($this->KeyInfo);
-        }
-
-        throw new Zend_InfoCard_Xml_Exception("Unable to locate a KeyInfo block");
-    }
-
-    /**
-     * Return the encrypted value of the block in base64 format
-     *
-     * @throws Zend_InfoCard_Xml_Exception
-     * @return string The Value of the CipherValue block in base64 format
-     */
-    public function getCipherValue()
-    {
-
-        $this->registerXPathNamespace('e', 'http://www.w3.org/2001/04/xmlenc#');
-
-        list($cipherdata) = $this->xpath("//e:CipherData");
-
-        if(!($cipherdata instanceof Zend_InfoCard_Xml_Element)) {
-            throw new Zend_InfoCard_Xml_Exception("Unable to find the e:CipherData block");
-        }
-
-        $cipherdata->registerXPathNameSpace('enc', 'http://www.w3.org/2001/04/xmlenc#');
-        list($ciphervalue) = $cipherdata->xpath("//enc:CipherValue");
-
-        if(!($ciphervalue instanceof Zend_InfoCard_Xml_Element)) {
-            throw new Zend_InfoCard_Xml_Exception("Unable to fidn the enc:CipherValue block");
-        }
-
-        return (string)$ciphervalue;
-    }
-}

+ 0 - 37
library/Zend/InfoCard/Xml/Exception.php

@@ -1,37 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Exception
- */
-require_once 'Zend/InfoCard/Exception.php';
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Xml_Exception extends Zend_InfoCard_Exception
-{
-}

+ 0 - 90
library/Zend/InfoCard/Xml/KeyInfo.php

@@ -1,90 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_Element
- */
-require_once 'Zend/InfoCard/Xml/Element.php';
-
-/**
- * Factory class to return a XML KeyInfo block based on input XML
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Xml_KeyInfo
-{
-    /**
-     * Constructor (disabled)
-     *
-     * @return void
-     */
-    private function __construct()
-    {
-    }
-
-    /**
-     * Returns an instance of KeyInfo object based on the input KeyInfo XML block
-     *
-     * @param string $xmlData The KeyInfo XML Block
-     * @return Zend_InfoCard_Xml_KeyInfo_Abstract
-     * @throws Zend_InfoCard_Xml_Exception
-     */
-    static public function getInstance($xmlData)
-    {
-
-        if($xmlData instanceof Zend_InfoCard_Xml_Element) {
-            $strXmlData = $xmlData->asXML();
-        } else if (is_string($xmlData)) {
-            $strXmlData = $xmlData;
-        } else {
-            throw new Zend_InfoCard_Xml_Exception("Invalid Data provided to create instance");
-        }
-
-        $sxe = simplexml_load_string($strXmlData);
-
-        $namespaces = $sxe->getDocNameSpaces();
-
-        if(!empty($namespaces)) {
-            foreach($sxe->getDocNameSpaces() as $namespace) {
-                switch($namespace) {
-                    case 'http://www.w3.org/2000/09/xmldsig#':
-                        include_once 'Zend/InfoCard/Xml/KeyInfo/XmlDSig.php';
-                        return simplexml_load_string($strXmlData, 'Zend_InfoCard_Xml_KeyInfo_XmlDSig');
-                    default:
-
-                        throw new Zend_InfoCard_Xml_Exception("Unknown KeyInfo Namespace provided");
-                    // We are ignoring these lines, as XDebug reports each as a "non executed" line
-                    // which breaks my coverage %
-                    // @codeCoverageIgnoreStart
-                }
-            }
-        }
-        // @codeCoverageIgnoreEnd
-
-        include_once 'Zend/InfoCard/Xml/KeyInfo/Default.php';
-        return simplexml_load_string($strXmlData, 'Zend_InfoCard_Xml_KeyInfo_Default');
-    }
-}

+ 0 - 37
library/Zend/InfoCard/Xml/KeyInfo/Abstract.php

@@ -1,37 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_Element
- */
-require_once 'Zend/InfoCard/Xml/Element.php';
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-abstract class Zend_InfoCard_Xml_KeyInfo_Abstract extends Zend_InfoCard_Xml_Element
-{
-}

+ 0 - 64
library/Zend/InfoCard/Xml/KeyInfo/Default.php

@@ -1,64 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_KeyInfo_Abstract
- */
-require_once 'Zend/InfoCard/Xml/KeyInfo/Abstract.php';
-
-/**
- * Zend_InfoCard_Xml_SecurityTokenReference
- */
-require_once 'Zend/InfoCard/Xml/SecurityTokenReference.php';
-
-/**
- * An object representation of a XML <KeyInfo> 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-2012 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);
-    }
-}

+ 0 - 38
library/Zend/InfoCard/Xml/KeyInfo/Interface.php

@@ -1,38 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-interface Zend_InfoCard_Xml_KeyInfo_Interface
-{
-    /**
-     * Return an object representing a KeyInfo data type
-     *
-     * @return Zend_InfoCard_Xml_KeyInfo
-     */
-    public function getKeyInfo();
-}

+ 0 - 76
library/Zend/InfoCard/Xml/KeyInfo/XmlDSig.php

@@ -1,76 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_KeyInfo_Abstract
- */
-require_once 'Zend/InfoCard/Xml/KeyInfo/Abstract.php';
-
-/**
- * Zend_InfoCard_Xml_EncryptedKey
- */
-require_once 'Zend/InfoCard/Xml/EncryptedKey.php';
-
-/**
- * Zend_InfoCard_Xml_KeyInfo_Interface
- */
-require_once 'Zend/InfoCard/Xml/KeyInfo/Interface.php';
-
-/**
- * Represents a Xml Digital Signature XML Data Block
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Xml_KeyInfo_XmlDSig
-    extends Zend_InfoCard_Xml_KeyInfo_Abstract
-    implements Zend_InfoCard_Xml_KeyInfo_Interface
-{
-    /**
-     * Returns an instance of the EncryptedKey Data Block
-     *
-     * @throws Zend_InfoCard_Xml_Exception
-     * @return Zend_InfoCard_Xml_EncryptedKey
-     */
-    public function getEncryptedKey()
-    {
-        $this->registerXPathNamespace('e', 'http://www.w3.org/2001/04/xmlenc#');
-        list($encryptedkey) = $this->xpath('//e:EncryptedKey');
-
-        if(!($encryptedkey instanceof Zend_InfoCard_Xml_Element)) {
-            throw new Zend_InfoCard_Xml_Exception("Failed to retrieve encrypted key");
-        }
-
-        return Zend_InfoCard_Xml_EncryptedKey::getInstance($encryptedkey);
-    }
-
-    /**
-     * Returns the KeyInfo Block within the encrypted key
-     *
-     * @return Zend_InfoCard_Xml_KeyInfo_Default
-     */
-    public function getKeyInfo()
-    {
-        return $this->getEncryptedKey()->getKeyInfo();
-    }
-}

+ 0 - 327
library/Zend/InfoCard/Xml/Security.php

@@ -1,327 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_Security_Transform
- */
-require_once 'Zend/InfoCard/Xml/Security/Transform.php';
-
-/**
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Xml_Security
-{
-    /**
-     * ASN.1 type INTEGER class
-     */
-    const ASN_TYPE_INTEGER = 0x02;
-
-    /**
-     * ASN.1 type BIT STRING class
-     */
-    const ASN_TYPE_BITSTRING = 0x03;
-
-    /**
-     * ASN.1 type SEQUENCE class
-     */
-    const ASN_TYPE_SEQUENCE = 0x30;
-
-    /**
-     * The URI for Canonical Method C14N Exclusive
-     */
-    const CANONICAL_METHOD_C14N_EXC = 'http://www.w3.org/2001/10/xml-exc-c14n#';
-
-    /**
-     * The URI for Signature Method SHA1
-     */
-    const SIGNATURE_METHOD_SHA1 = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1';
-
-    /**
-     * The URI for Digest Method SHA1
-     */
-    const DIGEST_METHOD_SHA1 = 'http://www.w3.org/2000/09/xmldsig#sha1';
-
-    /**
-     * The Identifier for RSA Keys
-     */
-    const RSA_KEY_IDENTIFIER = '300D06092A864886F70D0101010500';
-
-    /**
-     * Constructor  (disabled)
-     *
-     * @return void
-     */
-    private function __construct()
-    {
-    }
-
-    /**
-     * Validates the signature of a provided XML block
-     *
-     * @param  string $strXMLInput An XML block containing a Signature
-     * @return bool True if the signature validated, false otherwise
-     * @throws Zend_InfoCard_Xml_Security_Exception
-     */
-    static public function validateXMLSignature($strXMLInput)
-    {
-        if(!extension_loaded('openssl')) {
-            require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-            throw new Zend_InfoCard_Xml_Security_Exception("You must have the openssl extension installed to use this class");
-        }
-
-        $sxe = simplexml_load_string($strXMLInput);
-
-        if(!isset($sxe->Signature)) {
-            require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-            throw new Zend_InfoCard_Xml_Security_Exception("Could not identify XML Signature element");
-        }
-
-        if(!isset($sxe->Signature->SignedInfo)) {
-            require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-            throw new Zend_InfoCard_Xml_Security_Exception("Signature is missing a SignedInfo block");
-        }
-
-        if(!isset($sxe->Signature->SignatureValue)) {
-            require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-            throw new Zend_InfoCard_Xml_Security_Exception("Signature is missing a SignatureValue block");
-        }
-
-        if(!isset($sxe->Signature->KeyInfo)) {
-            require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-            throw new Zend_InfoCard_Xml_Security_Exception("Signature is missing a KeyInfo block");
-        }
-
-        if(!isset($sxe->Signature->KeyInfo->KeyValue)) {
-            require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-            throw new Zend_InfoCard_Xml_Security_Exception("Signature is missing a KeyValue block");
-        }
-
-        switch((string)$sxe->Signature->SignedInfo->CanonicalizationMethod['Algorithm']) {
-            case self::CANONICAL_METHOD_C14N_EXC:
-                $cMethod = (string)$sxe->Signature->SignedInfo->CanonicalizationMethod['Algorithm'];
-                break;
-            default:
-                require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-                throw new Zend_InfoCard_Xml_Security_Exception("Unknown or unsupported CanonicalizationMethod Requested");
-                break;
-        }
-
-        switch((string)$sxe->Signature->SignedInfo->SignatureMethod['Algorithm']) {
-            case self::SIGNATURE_METHOD_SHA1:
-                $sMethod = (string)$sxe->Signature->SignedInfo->SignatureMethod['Algorithm'];
-                break;
-            default:
-                require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-                throw new Zend_InfoCard_Xml_Security_Exception("Unknown or unsupported SignatureMethod Requested");
-                break;
-        }
-
-        switch((string)$sxe->Signature->SignedInfo->Reference->DigestMethod['Algorithm']) {
-            case self::DIGEST_METHOD_SHA1:
-                $dMethod = (string)$sxe->Signature->SignedInfo->Reference->DigestMethod['Algorithm'];
-                break;
-            default:
-                require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-                throw new Zend_InfoCard_Xml_Security_Exception("Unknown or unsupported DigestMethod Requested");
-                break;
-        }
-
-        $base64DecodeSupportsStrictParam = version_compare(PHP_VERSION, '5.2.0', '>=');
-
-        if ($base64DecodeSupportsStrictParam) {
-            $dValue = base64_decode((string)$sxe->Signature->SignedInfo->Reference->DigestValue, true);
-        } else {
-            $dValue = base64_decode((string)$sxe->Signature->SignedInfo->Reference->DigestValue);
-        }
-
-        if ($base64DecodeSupportsStrictParam) {
-            $signatureValue = base64_decode((string)$sxe->Signature->SignatureValue, true);
-        } else {
-            $signatureValue = base64_decode((string)$sxe->Signature->SignatureValue);
-        }
-
-        $transformer = new Zend_InfoCard_Xml_Security_Transform();
-
-        foreach($sxe->Signature->SignedInfo->Reference->Transforms->children() as $transform) {
-            $transformer->addTransform((string)$transform['Algorithm']);
-        }
-
-        $transformed_xml = $transformer->applyTransforms($strXMLInput);
-
-        $transformed_xml_binhash = pack("H*", sha1($transformed_xml));
-
-        if(!self::_secureStringCompare($transformed_xml_binhash, $dValue)) {
-            require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-            throw new Zend_InfoCard_Xml_Security_Exception("Locally Transformed XML does not match XML Document. Cannot Verify Signature");
-        }
-
-        $public_key = null;
-
-        switch(true) {
-            case isset($sxe->Signature->KeyInfo->KeyValue->X509Certificate):
-
-                $certificate = (string)$sxe->Signature->KeyInfo->KeyValue->X509Certificate;
-
-
-                $pem = "-----BEGIN CERTIFICATE-----\n" .
-                       wordwrap($certificate, 64, "\n", true) .
-                       "\n-----END CERTIFICATE-----";
-
-                $public_key = openssl_pkey_get_public($pem);
-
-                if(!$public_key) {
-                    require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-                    throw new Zend_InfoCard_Xml_Security_Exception("Unable to extract and prcoess X509 Certificate from KeyValue");
-                }
-
-                break;
-            case isset($sxe->Signature->KeyInfo->KeyValue->RSAKeyValue):
-
-                if(!isset($sxe->Signature->KeyInfo->KeyValue->RSAKeyValue->Modulus) ||
-                   !isset($sxe->Signature->KeyInfo->KeyValue->RSAKeyValue->Exponent)) {
-                       require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-                       throw new Zend_InfoCard_Xml_Security_Exception("RSA Key Value not in Modulus/Exponent form");
-                }
-
-                $modulus = base64_decode((string)$sxe->Signature->KeyInfo->KeyValue->RSAKeyValue->Modulus);
-                $exponent = base64_decode((string)$sxe->Signature->KeyInfo->KeyValue->RSAKeyValue->Exponent);
-
-                $pem_public_key = self::_getPublicKeyFromModExp($modulus, $exponent);
-
-                $public_key = openssl_pkey_get_public ($pem_public_key);
-
-                break;
-            default:
-                require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-                throw new Zend_InfoCard_Xml_Security_Exception("Unable to determine or unsupported representation of the KeyValue block");
-        }
-
-        $transformer = new Zend_InfoCard_Xml_Security_Transform();
-        $transformer->addTransform((string)$sxe->Signature->SignedInfo->CanonicalizationMethod['Algorithm']);
-
-        // The way we are doing our XML processing requires that we specifically add this
-        // (even though it's in the <Signature> parent-block).. otherwise, our canonical form
-        // fails signature verification
-        $sxe->Signature->SignedInfo->addAttribute('xmlns', 'http://www.w3.org/2000/09/xmldsig#');
-
-        $canonical_signedinfo = $transformer->applyTransforms($sxe->Signature->SignedInfo->asXML());
-
-        if(@openssl_verify($canonical_signedinfo, $signatureValue, $public_key)) {
-            return (string)$sxe->Signature->SignedInfo->Reference['URI'];
-        }
-
-        return false;
-    }
-
-    /**
-     * Transform an RSA Key in Modulus/Exponent format into a PEM encoding and
-     * return an openssl resource for it
-     *
-     * @param string $modulus The RSA Modulus in binary format
-     * @param string $exponent The RSA exponent in binary format
-     * @return string The PEM encoded version of the key
-     */
-    static protected function _getPublicKeyFromModExp($modulus, $exponent)
-    {
-        $modulusInteger  = self::_encodeValue($modulus, self::ASN_TYPE_INTEGER);
-        $exponentInteger = self::_encodeValue($exponent, self::ASN_TYPE_INTEGER);
-        $modExpSequence  = self::_encodeValue($modulusInteger . $exponentInteger, self::ASN_TYPE_SEQUENCE);
-        $modExpBitString = self::_encodeValue($modExpSequence, self::ASN_TYPE_BITSTRING);
-
-        $binRsaKeyIdentifier = pack( "H*", self::RSA_KEY_IDENTIFIER );
-
-        $publicKeySequence = self::_encodeValue($binRsaKeyIdentifier . $modExpBitString, self::ASN_TYPE_SEQUENCE);
-
-        $publicKeyInfoBase64 = base64_encode( $publicKeySequence );
-
-        $publicKeyString = "-----BEGIN PUBLIC KEY-----\n";
-        $publicKeyString .= wordwrap($publicKeyInfoBase64, 64, "\n", true);
-        $publicKeyString .= "\n-----END PUBLIC KEY-----\n";
-
-        return $publicKeyString;
-    }
-
-    /**
-     * Encode a limited set of data types into ASN.1 encoding format
-     * which is used in X.509 certificates
-     *
-     * @param string $data The data to encode
-     * @param const $type The encoding format constant
-     * @return string The encoded value
-     * @throws Zend_InfoCard_Xml_Security_Exception
-     */
-    static protected function _encodeValue($data, $type)
-    {
-        // Null pad some data when we get it (integer values > 128 and bitstrings)
-        if( (($type == self::ASN_TYPE_INTEGER) && (ord($data) > 0x7f)) ||
-            ($type == self::ASN_TYPE_BITSTRING)) {
-                $data = "\0$data";
-        }
-
-        $len = strlen($data);
-
-        // encode the value based on length of the string
-        // I'm fairly confident that this is by no means a complete implementation
-        // but it is enough for our purposes
-        switch(true) {
-            case ($len < 128):
-                return sprintf("%c%c%s", $type, $len, $data);
-            case ($len < 0x0100):
-                return sprintf("%c%c%c%s", $type, 0x81, $len, $data);
-            case ($len < 0x010000):
-                return sprintf("%c%c%c%c%s", $type, 0x82, $len / 0x0100, $len % 0x0100, $data);
-            default:
-                require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-                throw new Zend_InfoCard_Xml_Security_Exception("Could not encode value");
-        }
-
-        require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-        throw new Zend_InfoCard_Xml_Security_Exception("Invalid code path");
-    }
-
-    /**
-     * Securely compare two strings for equality while avoided C level memcmp()
-     * optimisations capable of leaking timing information useful to an attacker
-     * attempting to iteratively guess the unknown string (e.g. password) being
-     * compared against.
-     *
-     * @param string $a
-     * @param string $b
-     * @return bool
-     */
-    static protected function _secureStringCompare($a, $b)
-    {
-        if (strlen($a) !== strlen($b)) {
-            return false;
-        }
-        $result = 0;
-        for ($i = 0; $i < strlen($a); $i++) {
-            $result |= ord($a[$i]) ^ ord($b[$i]);
-        }
-        return $result == 0;
-    }
-}

+ 0 - 37
library/Zend/InfoCard/Xml/Security/Exception.php

@@ -1,37 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_Exception
- */
-require_once 'Zend/InfoCard/Xml/Exception.php';
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Xml_Security_Exception extends Zend_InfoCard_Xml_Exception
-{
-}

+ 0 - 116
library/Zend/InfoCard/Xml/Security/Transform.php

@@ -1,116 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * A class to create a transform rule set based on XML URIs and then apply those rules
- * in the correct order to a given XML input
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Xml_Security_Transform
-{
-    /**
-     * A list of transforms to apply
-     *
-     * @var array
-     */
-    protected $_transformList = array();
-
-    /**
-     * Returns the name of the transform class based on a given URI
-     *
-     * @throws Zend_InfoCard_Xml_Security_Exception
-     * @param string $uri The transform URI
-     * @return string The transform implementation class name
-     */
-    protected function _findClassbyURI($uri)
-    {
-        switch($uri) {
-            case 'http://www.w3.org/2000/09/xmldsig#enveloped-signature':
-                return 'Zend_InfoCard_Xml_Security_Transform_EnvelopedSignature';
-            case 'http://www.w3.org/2001/10/xml-exc-c14n#':
-                return 'Zend_InfoCard_Xml_Security_Transform_XmlExcC14N';
-            default:
-                require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-                throw new Zend_InfoCard_Xml_Security_Exception("Unknown or Unsupported Transformation Requested");
-        }
-    }
-
-    /**
-     * Add a Transform URI to the list of transforms to perform
-     *
-     * @param string $uri The Transform URI
-     * @return Zend_InfoCard_Xml_Security_Transform
-     */
-    public function addTransform($uri)
-    {
-        $class = $this->_findClassbyURI($uri);
-
-        $this->_transformList[] = array('uri' => $uri,
-                                        'class' => $class);
-        return $this;
-    }
-
-    /**
-     * Return the list of transforms to perform
-     *
-     * @return array The list of transforms
-     */
-    public function getTransformList()
-    {
-        return $this->_transformList;
-    }
-
-    /**
-     * Apply the transforms in the transform list to the input XML document
-     *
-     * @param string $strXmlDocument The input XML
-     * @return string The XML after the transformations have been applied
-     */
-    public function applyTransforms($strXmlDocument)
-    {
-        foreach($this->_transformList as $transform) {
-            if (!class_exists($transform['class'])) {
-                require_once 'Zend/Loader.php';
-                Zend_Loader::loadClass($transform['class']);
-            }
-
-            $transformer = new $transform['class'];
-
-            // We can't really test this check because it would require logic changes in the component itself
-            // @codeCoverageIgnoreStart
-            if(!($transformer instanceof Zend_InfoCard_Xml_Security_Transform_Interface)) {
-                require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-                throw new Zend_InfoCard_Xml_Security_Exception("Transforms must implement the Transform Interface");
-            }
-            // @codeCoverageIgnoreEnd
-
-            $strXmlDocument = $transformer->transform($strXmlDocument);
-        }
-
-        return $strXmlDocument;
-    }
-}

+ 0 - 60
library/Zend/InfoCard/Xml/Security/Transform/EnvelopedSignature.php

@@ -1,60 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_Security_Transform_Interface
- */
-require_once 'Zend/InfoCard/Xml/Security/Transform/Interface.php';
-
-/**
- * A object implementing the EnvelopedSignature XML Transform
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Xml_Security_Transform_EnvelopedSignature
-    implements Zend_InfoCard_Xml_Security_Transform_Interface
-{
-    /**
-     * Transforms the XML Document according to the EnvelopedSignature Transform
-     *
-     * @throws Zend_InfoCard_Xml_Security_Transform_Exception
-     * @param string $strXMLData The input XML data
-     * @return string the transformed XML data
-     */
-    public function transform($strXMLData)
-    {
-        $sxe = simplexml_load_string($strXMLData);
-
-        if(!$sxe->Signature) {
-            require_once 'Zend/InfoCard/Xml/Security/Transform/Exception.php';
-            throw new Zend_InfoCard_Xml_Security_Transform_Exception("Unable to locate Signature Block for EnvelopedSignature Transform");
-        }
-
-        unset($sxe->Signature);
-
-        return $sxe->asXML();
-    }
-}

+ 0 - 37
library/Zend/InfoCard/Xml/Security/Transform/Exception.php

@@ -1,37 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_Security_Exception
- */
-require_once 'Zend/InfoCard/Xml/Security/Exception.php';
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Xml_Security_Transform_Exception extends Zend_InfoCard_Xml_Security_Exception
-{
-}

+ 0 - 43
library/Zend/InfoCard/Xml/Security/Transform/Interface.php

@@ -1,43 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Interface for XML Security Transforms
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-interface Zend_InfoCard_Xml_Security_Transform_Interface
-{
-    /**
-     * Transform the given XML string according to the transform rules
-     * implemented by the object using this interface
-     *
-     * @throws Zend_InfoCard_Xml_Security_Transform_Exception
-     * @param string $strXmlData the input XML
-     * @return string the output XML
-     */
-    public function transform($strXmlData);
-}

+ 0 - 59
library/Zend/InfoCard/Xml/Security/Transform/XmlExcC14N.php

@@ -1,59 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_Security_Transform_Interface
- */
-require_once 'Zend/InfoCard/Xml/Security/Transform/Interface.php';
-
-/**
- * A Transform to perform C14n XML Exclusive Canonicalization
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml_Security
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Xml_Security_Transform_XmlExcC14N
-    implements Zend_InfoCard_Xml_Security_Transform_Interface
-{
-    /**
-     * Transform the input XML based on C14n XML Exclusive Canonicalization rules
-     *
-     * @throws Zend_InfoCard_Xml_Security_Transform_Exception
-     * @param string $strXMLData The input XML
-     * @return string The output XML
-     */
-    public function transform($strXMLData)
-    {
-        $dom = new DOMDocument();
-        $dom->loadXML($strXMLData);
-
-        if(method_exists($dom, 'C14N')) {
-            return $dom->C14N(true, false);
-        }
-
-        require_once 'Zend/InfoCard/Xml/Security/Transform/Exception.php';
-        throw new Zend_InfoCard_Xml_Security_Transform_Exception("This transform requires the C14N() method to exist in the DOM extension");
-    }
-}

+ 0 - 173
library/Zend/InfoCard/Xml/SecurityTokenReference.php

@@ -1,173 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-/**
- * Zend_InfoCard_Xml_Element
- */
-require_once 'Zend/InfoCard/Xml/Element.php';
-
-/**
- * Represents a SecurityTokenReference XML block
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage Zend_InfoCard_Xml
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-class Zend_InfoCard_Xml_SecurityTokenReference extends Zend_InfoCard_Xml_Element
-{
-    /**
-     * Base64 Binary Encoding URI
-     */
-    const ENCODING_BASE64BIN = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary';
-
-    /**
-     * Return an instance of the object based on the input XML
-     *
-     * @param string $xmlData The SecurityTokenReference XML Block
-     * @return Zend_InfoCard_Xml_SecurityTokenReference
-     * @throws Zend_InfoCard_Xml_Exception
-     */
-    static public function getInstance($xmlData)
-    {
-        if($xmlData instanceof Zend_InfoCard_Xml_Element) {
-            $strXmlData = $xmlData->asXML();
-        } else if (is_string($xmlData)) {
-            $strXmlData = $xmlData;
-        } else {
-            throw new Zend_InfoCard_Xml_Exception("Invalid Data provided to create instance");
-        }
-
-        $sxe = simplexml_load_string($strXmlData);
-
-        if($sxe->getName() != "SecurityTokenReference") {
-            throw new Zend_InfoCard_Xml_Exception("Invalid XML Block provided for SecurityTokenReference");
-        }
-
-        return simplexml_load_string($strXmlData, "Zend_InfoCard_Xml_SecurityTokenReference");
-    }
-
-    /**
-     * Return the Key Identifier XML Object
-     *
-     * @return Zend_InfoCard_Xml_Element
-     * @throws Zend_InfoCard_Xml_Exception
-     */
-    protected function _getKeyIdentifier()
-    {
-        $this->registerXPathNamespace('o', 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd');
-        list($keyident) = $this->xpath('//o:KeyIdentifier');
-
-        if(!($keyident instanceof Zend_InfoCard_Xml_Element)) {
-            throw new Zend_InfoCard_Xml_Exception("Failed to retrieve Key Identifier");
-        }
-
-        return $keyident;
-    }
-
-    /**
-     * Return the Key URI identifying the thumbprint type used
-     *
-     * @return string The thumbprint type URI
-     * @throws  Zend_InfoCard_Xml_Exception
-     */
-    public function getKeyThumbprintType()
-    {
-
-        $keyident = $this->_getKeyIdentifier();
-
-        $dom = self::convertToDOM($keyident);
-
-        if(!$dom->hasAttribute('ValueType')) {
-            throw new Zend_InfoCard_Xml_Exception("Key Identifier did not provide a type for the value");
-        }
-
-        return $dom->getAttribute('ValueType');
-    }
-
-
-    /**
-     * Return the thumbprint encoding type used as a URI
-     *
-     * @return string the URI of the thumbprint encoding used
-     * @throws Zend_InfoCard_Xml_Exception
-     */
-    public function getKeyThumbprintEncodingType()
-    {
-
-        $keyident = $this->_getKeyIdentifier();
-
-        $dom = self::convertToDOM($keyident);
-
-        if(!$dom->hasAttribute('EncodingType')) {
-            throw new Zend_InfoCard_Xml_Exception("Unable to determine the encoding type for the key identifier");
-        }
-
-        return $dom->getAttribute('EncodingType');
-    }
-
-    /**
-     * Get the key reference data used to identify the public key
-     *
-     * @param bool $decode if true, will return a decoded version of the key
-     * @return string the key reference thumbprint, either in binary or encoded form
-     * @throws Zend_InfoCard_Xml_Exception
-     */
-    public function getKeyReference($decode = true)
-    {
-        $keyIdentifier = $this->_getKeyIdentifier();
-
-        $dom = self::convertToDOM($keyIdentifier);
-        $encoded = $dom->nodeValue;
-
-        if(empty($encoded)) {
-            throw new Zend_InfoCard_Xml_Exception("Could not find the Key Reference Encoded Value");
-        }
-
-        if($decode) {
-
-            $decoded = "";
-            switch($this->getKeyThumbprintEncodingType()) {
-                case self::ENCODING_BASE64BIN:
-
-                    if(version_compare(PHP_VERSION, "5.2.0", ">=")) {
-                        $decoded = base64_decode($encoded, true);
-                    } else {
-                        $decoded = base64_decode($encoded);
-                    }
-
-                    break;
-                default:
-                    throw new Zend_InfoCard_Xml_Exception("Unknown Key Reference Encoding Type: {$this->getKeyThumbprintEncodingType()}");
-            }
-
-            if(!$decoded || empty($decoded)) {
-                throw new Zend_InfoCard_Xml_Exception("Failed to decode key reference");
-            }
-
-            return $decoded;
-        }
-
-        return $encoded;
-    }
-}

+ 0 - 2
tests/Zend/AllTests.php

@@ -55,7 +55,6 @@ require_once 'Zend/Filter/AllTests.php';
 require_once 'Zend/Form/AllTests.php';
 require_once 'Zend/Gdata/AllTests.php';
 require_once 'Zend/Http/AllTests.php';
-require_once 'Zend/InfoCard/AllTests.php';
 require_once 'Zend/JsonTest.php';
 require_once 'Zend/Json/AllTests.php';
 require_once 'Zend/Layout/AllTests.php';
@@ -198,7 +197,6 @@ class Zend_AllTests
         $suite->addTest(Zend_Form_AllTests::suite());
         $suite->addTest(Zend_Gdata_AllTests::suite());
         $suite->addTest(Zend_Http_AllTests::suite());
-        $suite->addTest(Zend_InfoCard_AllTests::suite());
         $suite->addTestSuite('Zend_JsonTest');
         $suite->addTest(Zend_Json_AllTests::suite());
         $suite->addTest(Zend_Layout_AllTests::suite());

+ 0 - 64
tests/Zend/InfoCard/AllTests.php

@@ -1,64 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-if (!defined('PHPUnit_MAIN_METHOD')) {
-    define('PHPUnit_MAIN_METHOD', 'Zend_InfoCard_AllTests::main');
-}
-
-require_once 'Zend/InfoCard/XmlParsingTest.php';
-require_once 'Zend/InfoCard/ProcessTest.php';
-require_once 'Zend/InfoCard/AssertionTest.php';
-require_once 'Zend/InfoCard/CipherTest.php';
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @group      Zend_InfoCard
- */
-class Zend_InfoCard_AllTests
-{
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        $suite = new PHPUnit_Framework_TestSuite("Zend Framework - Zend_InfoCard");
-
-        if(extension_loaded('openssl')) {
-            $suite->addTestSuite('Zend_InfoCard_AssertionTest');
-            $suite->addTestSuite('Zend_InfoCard_ProcessTest');
-            $suite->addTestSuite('Zend_InfoCard_XmlParsingTest');
-            $suite->addTestSuite('Zend_InfoCard_CipherTest');
-        }
-
-        return $suite;
-    }
-}
-
-if (PHPUnit_MAIN_METHOD == 'Zend_InfoCard_AllTests::main') {
-    Zend_InfoCard_AllTests::main();
-}

+ 0 - 108
tests/Zend/InfoCard/AssertionTest.php

@@ -1,108 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-// Call Zend_InfoCard_AssertionTest::main() if this source file is executed directly.
-if (!defined("PHPUnit_MAIN_METHOD")) {
-    define("PHPUnit_MAIN_METHOD", "Zend_InfoCard_AssertionTest::main");
-}
-
-require_once 'Zend/InfoCard.php';
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @group      Zend_InfoCard
- */
-class Zend_InfoCard_AssertionTest extends PHPUnit_Framework_TestCase
-{
-    protected $_xmlDocument;
-
-    /**
-     * Runs the test methods of this class.
-     *
-     * @access public
-     * @static
-     */
-    public static function main()
-    {
-
-        $suite  = new PHPUnit_Framework_TestSuite("Zend_InfoCard_AssertionTest");
-        $result = PHPUnit_TextUI_TestRunner::run($suite);
-    }
-
-    public function setUp()
-    {
-        $this->tokenDocument = dirname(__FILE__) . '/_files/signedToken.xml';
-        $this->sslPubKey     = dirname(__FILE__) . '/_files/ssl_pub.cert';
-        $this->sslPrvKey     = dirname(__FILE__) . '/_files/ssl_private.cert';
-        $this->loadXmlDocument();
-    }
-
-    public function loadXmlDocument()
-    {
-        $this->_xmlDocument = file_get_contents($this->tokenDocument);
-    }
-
-    public function testAssertionProcess()
-    {
-        date_default_timezone_set("America/Los_Angeles");
-
-        $assertions = Zend_InfoCard_Xml_Assertion::getInstance($this->_xmlDocument);
-
-        $this->assertTrue($assertions instanceof Zend_InfoCard_Xml_Assertion_Saml);
-
-        $this->assertSame($assertions->getMajorVersion(), 1);
-        $this->assertSame($assertions->getMinorVersion(), 1);
-        $this->assertSame($assertions->getAssertionID(), "uuid:5cf2cd76-acf6-45ef-9059-a811801b80cc");
-        $this->assertSame($assertions->getIssuer(), "http://schemas.xmlsoap.org/ws/2005/05/identity/issuer/self");
-        $this->assertSame($assertions->getConfirmationMethod(), Zend_InfoCard_Xml_Assertion_Saml::CONFIRMATION_BEARER);
-        $this->assertSame($assertions->getIssuedTimestamp(), 1190153823);
-
-    }
-
-    public function testAssertionErrors()
-    {
-        try {
-            Zend_InfoCard_Xml_Assertion::getInstance(10);
-            $this->fail("Exception Not Thrown as Expected");
-        } catch(Exception $e) {
-            /* yay */
-        }
-
-        $doc = file_get_contents(dirname(__FILE__) . '/_files/signedToken_bad_type.xml');
-
-        try {
-            $assertions = Zend_InfoCard_Xml_Assertion::getInstance($doc);
-            $this->fail("Exception Not thrown as expected");
-        } catch(Exception $e) {
-            /* yay */
-        }
-    }
-}
-
-// Call Zend_InfoCard_AssertionTest::main() if this source file is executed directly.
-if (PHPUnit_MAIN_METHOD == "Zend_InfoCard_AssertionTest::main") {
-    Zend_InfoCard_AssertionTest::main();
-}

+ 0 - 109
tests/Zend/InfoCard/CipherTest.php

@@ -1,109 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-// Call Zend_InfoCard_ProcessTest::main() if this source file is executed directly.
-if (!defined("PHPUnit_MAIN_METHOD")) {
-    define("PHPUnit_MAIN_METHOD", "Zend_InfoCard_CipherTest::main");
-}
-
-require_once 'Zend/InfoCard.php';
-require_once 'Zend/InfoCard/Cipher/Pki/Adapter/Rsa.php';
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @group      Zend_InfoCard
- */
-class Zend_InfoCard_CipherTest extends PHPUnit_Framework_TestCase
-{
-
-    public function testPkiPadding()
-    {
-        if (!extension_loaded('openssl')) {
-            $this->markTestSkipped('The openssl extension is not loaded.');
-        }
-
-        try {
-            $obj = new Zend_InfoCard_Cipher_Pki_Adapter_Rsa("thiswillbreak");
-            $this->fail("Exception not thrown as expected");
-        } catch(Exception $e) {
-            /* yay */
-        }
-
-        $obj = new Zend_InfoCard_Cipher_Pki_Adapter_Rsa();
-
-        $prv_key = file_get_Contents(dirname(__FILE__) . "/_files/ssl_private.cert");
-
-        try {
-            $obj->decrypt("Foo", $prv_key, null, "foo");
-            $this->fail("Expected Exception Not Thrown");
-        } catch(Exception $e) {
-            /* yay */
-        }
-
-        $result = $obj->decrypt("foo", $prv_key, null, Zend_InfoCard_Cipher_Pki_Adapter_Abstract::NO_PADDING);
-
-        // This is sort of werid, but since we don't have a real PK-encrypted string to test against for NO_PADDING
-        // mode we decrypt the string "foo" instead. Mathmatically we will always arrive at the same resultant
-        // string so if our hash doesn't match then something broke.
-        $this->assertSame(md5($result), "286c1991e1f7040229a6f223065b91b5");
-    }
-
-    public function testPKIDecryptBadKey()
-    {
-        if (!extension_loaded('openssl')) {
-            $this->markTestSkipped('The openssl extension is not loaded.');
-        }
-
-        $obj = new Zend_InfoCard_Cipher_Pki_Adapter_Rsa();
-
-        try {
-            $obj->decrypt("Foo", "bar");
-            $this->fail("Exception not thrown as expected");
-        } catch(Exception $e) {
-            /* yay */
-        }
-
-    }
-
-    public function testCipherFactory()
-    {
-        if (!defined('MCRYPT_RIJNDAEL_128')) {
-            $this->markTestSkipped('Use of the Zend_InfoCard component requires the mcrypt extension to be enabled in PHP');
-        }
-
-        $this->assertTrue(Zend_InfoCard_Cipher::getInstanceByURI(Zend_InfoCard_Cipher::ENC_AES128CBC)
-                          instanceof Zend_InfoCard_Cipher_Symmetric_Adapter_Aes128cbc);
-        $this->assertTrue(Zend_InfoCard_Cipher::getInstanceByURI(Zend_InfoCard_Cipher::ENC_RSA)
-                          instanceof Zend_InfoCard_Cipher_Pki_Adapter_Rsa);
-
-        try {
-            Zend_InfoCard_Cipher::getInstanceByURI("Broken");
-            $this->fail("Exception not thrown as expected");
-        } catch(Exception $e) {
-            /* yay */
-        }
-    }
-}

+ 0 - 320
tests/Zend/InfoCard/ProcessTest.php

@@ -1,320 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id$
- */
-
-// Call Zend_InfoCard_ProcessTest::main() if this source file is executed directly.
-if (!defined("PHPUnit_MAIN_METHOD")) {
-    define("PHPUnit_MAIN_METHOD", "Zend_InfoCard_ProcessTest::main");
-}
-
-require_once 'Zend/InfoCard.php';
-require_once 'Zend/InfoCard/Adapter/Default.php';
-require_once 'Zend/InfoCard/Cipher/Symmetric/Adapter/Aes256cbc.php';
-
-/**
- * @category   Zend
- * @package    Zend_InfoCard
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @group      Zend_InfoCard
- */
-class Zend_InfoCard_ProcessTest extends PHPUnit_Framework_TestCase
-{
-    protected $_xmlDocument;
-
-    /**
-     * Runs the test methods of this class.
-     *
-     * @access public
-     * @static
-     */
-    public static function main()
-    {
-
-        $suite  = new PHPUnit_Framework_TestSuite("Zend_InfoCard_ProcessTest");
-        $result = PHPUnit_TextUI_TestRunner::run($suite);
-    }
-
-    public function setUp()
-    {
-        $this->tokenDocument = dirname(__FILE__) . '/_files/encryptedtoken.xml';
-        $this->sslPubKey     = dirname(__FILE__) . '/_files/ssl_pub.cert';
-        $this->sslPrvKey     = dirname(__FILE__) . '/_files/ssl_private.cert';
-        $this->loadXmlDocument();
-        $_SERVER['SERVER_NAME'] = "192.168.1.105";
-        $_SERVER['SERVER_PORT'] = 80;
-    }
-
-    public function loadXmlDocument()
-    {
-        $this->_xmlDocument = file_get_contents($this->tokenDocument);
-    }
-
-    public function testCertificatePairs()
-    {
-        try {
-            $infoCard = new Zend_InfoCard();
-        } catch (Zend_InfoCard_Exception $e) {
-            $message = $e->getMessage();
-            if (preg_match('/requires.+mcrypt/', $message)) {
-                $this->markTestSkipped($message);
-            } else {
-                throw $e;
-            }
-        }
-
-        $key_id = $infoCard->addCertificatePair($this->sslPrvKey, $this->sslPubKey);
-
-        $this->assertTrue((bool)$key_id);
-
-        $key_pair = $infoCard->getCertificatePair($key_id);
-
-        $this->assertTrue(!empty($key_pair['public']));
-        $this->assertTrue(!empty($key_pair['private']));
-        $this->assertTrue(!empty($key_pair['type_uri']));
-
-        $infoCard->removeCertificatePair($key_id);
-
-        $failed = false;
-
-        try {
-            $key_pair = $infoCard->getCertificatePair($key_id);
-        } catch(Zend_InfoCard_Exception $e) {
-            $failed = true;
-        }
-
-        $this->assertTrue($failed);
-
-        try {
-            $infoCard->addCertificatePair("I don't exist", "I don't exist");
-        } catch(Zend_InfoCard_Exception $e) {
-            $this->assertTrue(true);
-        } catch(Exception $e) {
-            $this->assertFalse(true);
-        }
-
-        $key_id = $infoCard->addCertificatePair($this->sslPrvKey, $this->sslPubKey, Zend_InfoCard_Cipher::ENC_RSA_OAEP_MGF1P, "foo");
-
-        try {
-            $key_id = $infoCard->addCertificatePair($this->sslPrvKey, $this->sslPubKey, Zend_InfoCard_Cipher::ENC_RSA_OAEP_MGF1P, "foo");
-        } catch(Zend_InfoCard_Exception $e) {
-            $this->assertTrue(true);
-        } catch(Exception $e) {
-            $this->assertFalse(true);
-        }
-
-        $this->assertTrue(!empty($key_id));
-
-        try {
-            $infoCard->removeCertificatePair($key_id);
-            $infoCard->addCertificatePair($this->sslPrvKey, $this->sslPubKey, "Doesn't Exist", "foo");
-        } catch(Zend_InfoCard_Exception $e) {
-            $this->assertTrue(true);
-        } catch(Exception $e) {
-            $this->assertFalse(true);
-        }
-    }
-
-    public function testStandAloneProcess()
-    {
-        if (version_compare(PHP_VERSION, '5.2.0', '<')) {
-            $this->markTestSkipped('DOMDocument::C14N() not available until PHP 5.2.0');
-        }
-
-        try {
-            $infoCard = new Zend_InfoCard();
-        } catch (Zend_InfoCard_Exception $e) {
-            $message = $e->getMessage();
-            if (preg_match('/requires.+mcrypt/', $message)) {
-                $this->markTestSkipped($message);
-            } else {
-                throw $e;
-            }
-        }
-
-        $infoCard->addCertificatePair($this->sslPrvKey, $this->sslPubKey);
-
-        $claims = $infoCard->process($this->_xmlDocument);
-
-        $this->assertTrue($claims instanceof Zend_InfoCard_Claims);
-    }
-
-    public function testPlugins()
-    {
-        if (version_compare(PHP_VERSION, '5.2.0', '<')) {
-            $this->markTestSkipped('DOMDocument::C14N() not available until PHP 5.2.0');
-        }
-
-        $adapter  = new _Zend_InfoCard_Test_Adapter();
-
-        try {
-            $infoCard = new Zend_InfoCard();
-        } catch (Zend_InfoCard_Exception $e) {
-            $message = $e->getMessage();
-            if (preg_match('/requires.+mcrypt/', $message)) {
-                $this->markTestSkipped($message);
-            } else {
-                throw $e;
-            }
-        }
-
-        $infoCard->setAdapter($adapter);
-
-        $result = $infoCard->getAdapter() instanceof Zend_InfoCard_Adapter_Interface;
-
-        $this->assertTrue($result);
-        $this->assertTrue($infoCard->getAdapter() instanceof _Zend_InfoCard_Test_Adapter);
-
-        $infoCard->addCertificatePair($this->sslPrvKey, $this->sslPubKey);
-
-        $claims = $infoCard->process($this->_xmlDocument);
-
-        $pki_object = new Zend_InfoCard_Cipher_Pki_Adapter_Rsa(Zend_InfoCard_Cipher_Pki_Adapter_Abstract::NO_PADDING);
-
-        $infoCard->setPkiCipherObject($pki_object);
-
-        $this->assertTrue($pki_object === $infoCard->getPkiCipherObject());
-
-        $sym_object = new Zend_InfoCard_Cipher_Symmetric_Adapter_Aes256cbc();
-
-        $infoCard->setSymCipherObject($sym_object);
-
-        $this->assertTrue($sym_object === $infoCard->getSymCipherObject());
-    }
-
-    public function testClaims()
-    {
-        if (version_compare(PHP_VERSION, '5.2.0', '<')) {
-            $this->markTestSkipped('DOMDocument::C14N() not available until PHP 5.2.0');
-        }
-
-        try {
-            $infoCard = new Zend_InfoCard();
-        } catch (Zend_InfoCard_Exception $e) {
-            $message = $e->getMessage();
-            if (preg_match('/requires.+mcrypt/', $message)) {
-                $this->markTestSkipped($message);
-            } else {
-                throw $e;
-            }
-        }
-
-        $infoCard->addCertificatePair($this->sslPrvKey, $this->sslPubKey);
-
-        $claims = $infoCard->process($this->_xmlDocument);
-
-        $this->assertTrue($claims instanceof Zend_InfoCard_Claims);
-
-        $this->assertFalse($claims->isValid());
-
-        $this->assertSame($claims->getCode(), Zend_InfoCard_Claims::RESULT_VALIDATION_FAILURE);
-
-        $errormsg = $claims->getErrorMsg();
-        $this->assertTrue(!empty($errormsg));
-
-
-        @$claims->forceValid();
-
-        $this->assertTrue($claims->isValid());
-
-        $this->assertSame($claims->emailaddress, "john@zend.com");
-        $this->assertSame($claims->givenname, "John");
-        $this->assertSame($claims->surname, "Coggeshall");
-        $this->assertSame($claims->getCardID(), "rW1/y9BuncoBK4WSipF2hHYParxxgMHk6ANBrhz1Zr4=");
-        $this->assertSame($claims->getClaim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"), "john@zend.com");
-        $this->assertSame($claims->getDefaultNamespace(), "http://schemas.xmlsoap.org/ws/2005/05/identity/claims");
-
-        try {
-            unset($claims->givenname);
-        } catch(Zend_InfoCard_Exception $e) {
-
-        } catch(Exception $e) {
-            $this->assertFalse(true);
-        }
-
-
-        try {
-            $claims->givenname = "Test";
-        } catch(Zend_InfoCard_Exception $e) {
-
-        } catch(Exception $e) {
-            $this->assertFalse(true);
-        }
-
-        $this->assertTrue(isset($claims->givenname));
-    }
-
-    public function testDefaultAdapter()
-    {
-        $adapter = new Zend_InfoCard_Adapter_Default();
-
-        $this->assertTrue($adapter->storeAssertion(1, 2, array(3)));
-        $this->assertFalse($adapter->retrieveAssertion(1, 2));
-        $this->assertTrue(is_null($adapter->removeAssertion(1, 2)));
-    }
-
-    public function testTransforms()
-    {
-        $trans = new Zend_InfoCard_Xml_Security_Transform();
-
-        try {
-            $trans->addTransform("foo");
-            $this->fail("Expected Exception Not Thrown");
-        } catch(Exception $e) {
-            /* yay */
-        }
-
-        $this->assertTrue(is_array($trans->getTransformList()));
-
-    }
-}
-
-class _Zend_InfoCard_Test_Adapter
-    extends PHPUnit_Framework_TestCase
-    implements Zend_InfoCard_Adapter_Interface
-{
-    public function storeAssertion($assertionURI, $assertionID, $conditions)
-    {
-        $this->assertTrue(!empty($assertionURI));
-        $this->assertTrue(!empty($assertionID));
-        $this->assertTrue(!empty($conditions));
-        return true;
-    }
-
-    public function retrieveAssertion($assertionURI, $assertionID)
-    {
-        $this->assertTrue(!empty($assertionURI));
-        $this->assertTrue(!empty($assertionID));
-        return false;
-    }
-
-    public function removeAssertion($asserionURI, $assertionID)
-    {
-        $this->assertTrue(!empty($assertionURI));
-        $this->asserTrue(!empty($assertionID));
-    }
-}
-
-// Call Zend_InfoCard_ProcessTest::main() if this source file is executed directly.
-if (PHPUnit_MAIN_METHOD == "Zend_InfoCard_ProcessTest::main") {
-    Zend_InfoCard_ProcessTest::main();
-}

File diff ditekan karena terlalu besar
+ 0 - 92
tests/Zend/InfoCard/XmlParsingTest.php


+ 0 - 15
tests/Zend/InfoCard/_files/encryptedkey.xml

@@ -1,15 +0,0 @@
-<e:BadEncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
-                        <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
-                                <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
-                        </e:EncryptionMethod>
-                        <KeyInfo>
-                                <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
-                                        <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1"
-                                                                         EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">/OCqQ7Np25sOiA+4OsFh1R6qIeY=</o:KeyIdentifier>
-                                </o:SecurityTokenReference>
-                        </KeyInfo>
-                        <e:CipherData>
-                                <e:CipherValue>AIgtBEv9lGMikyHjV/b5mQ5LbLyupNtRH8hl5I6tJsZI5CYP32BLo9FgxAY5ZReEv+XZbqcs5KORBvTbMkP6l7MY32WJGPBDDMSB7k6DshryoZqlmGMbjt2g1nM7xOuwwfru1jC7t+qCBXL4PPBpHDhHzAW7u8tB8LQCU6GklIFa1+GoZbQ00BY/OoPbE3rxhxgGPAHXfYPLjGALIkYo9czeTO/zfcydHl5Xcyp/PsskSOUhNFcftxG+fQELb/oqc50ldBWlxBM/qU7fLI4KRfUag3J5sanCUsgiYdF0iQNfiYnUKLa9ThDHjHUQnB5EEt77cM2/DKQkyExMBBgYcRo9GzqyLXiDCYWVatCQU6rAD8NkBBpFs8W/0QXIV1J/S3DuZS3Eo4x27gRlT5YfUeO7jAZvwqy51WHNXwq13QTV2AOGfvpK3054sZm+10jdfAq6tgYdShQgO2kHRGP1q9vAC3SfD49mP9q+AemJrAkiR2HZTxkEQ+AttdfPhc2dzdLXp+ukQdqpL/xlywIp+KIim+YVjhO+Bi92rRn5Kl0h7q6MkpoTGI1F+akmNhD6VmB1Nd0G6e4AGTisuyd+vygEH7fsZhZuiMSknajfgPgazKiLUihwRvfk4FJm18Ju97tXcl6LhIJpkOcq7sI25GhWz0mHX1ErOf/949pcozo=</e:CipherValue>
-                        </e:CipherData>
-                </e:EncryptedKey>
-

+ 0 - 15
tests/Zend/InfoCard/_files/encryptedkey_bad_block.xml

@@ -1,15 +0,0 @@
-<e:BadEncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
-                        <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
-                                <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
-                        </e:EncryptionMethod>
-                        <KeyInfo>
-                                <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
-                                        <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1"
-                                                                         EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">/OCqQ7Np25sOiA+4OsFh1R6qIeY=</o:KeyIdentifier>
-                                </o:SecurityTokenReference>
-                        </KeyInfo>
-                        <e:CipherData>
-                                <e:CipherValue>AIgtBEv9lGMikyHjV/b5mQ5LbLyupNtRH8hl5I6tJsZI5CYP32BLo9FgxAY5ZReEv+XZbqcs5KORBvTbMkP6l7MY32WJGPBDDMSB7k6DshryoZqlmGMbjt2g1nM7xOuwwfru1jC7t+qCBXL4PPBpHDhHzAW7u8tB8LQCU6GklIFa1+GoZbQ00BY/OoPbE3rxhxgGPAHXfYPLjGALIkYo9czeTO/zfcydHl5Xcyp/PsskSOUhNFcftxG+fQELb/oqc50ldBWlxBM/qU7fLI4KRfUag3J5sanCUsgiYdF0iQNfiYnUKLa9ThDHjHUQnB5EEt77cM2/DKQkyExMBBgYcRo9GzqyLXiDCYWVatCQU6rAD8NkBBpFs8W/0QXIV1J/S3DuZS3Eo4x27gRlT5YfUeO7jAZvwqy51WHNXwq13QTV2AOGfvpK3054sZm+10jdfAq6tgYdShQgO2kHRGP1q9vAC3SfD49mP9q+AemJrAkiR2HZTxkEQ+AttdfPhc2dzdLXp+ukQdqpL/xlywIp+KIim+YVjhO+Bi92rRn5Kl0h7q6MkpoTGI1F+akmNhD6VmB1Nd0G6e4AGTisuyd+vygEH7fsZhZuiMSknajfgPgazKiLUihwRvfk4FJm18Ju97tXcl6LhIJpkOcq7sI25GhWz0mHX1ErOf/949pcozo=</e:CipherValue>
-                        </e:CipherData>
-                </e:BadEncryptedKey>
-

+ 0 - 15
tests/Zend/InfoCard/_files/encryptedkey_missing_enc_algo.xml

@@ -1,15 +0,0 @@
-<e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
-                        <e:EncryptionMethod >
-                                <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
-                        </e:EncryptionMethod>
-                        <KeyInfo>
-                                <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
-                                        <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1"
-                                                                         EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">/OCqQ7Np25sOiA+4OsFh1R6qIeY=</o:KeyIdentifier>
-                                </o:SecurityTokenReference>
-                        </KeyInfo>
-                        <e:CipherData>
-                                <e:CipherValue>AIgtBEv9lGMikyHjV/b5mQ5LbLyupNtRH8hl5I6tJsZI5CYP32BLo9FgxAY5ZReEv+XZbqcs5KORBvTbMkP6l7MY32WJGPBDDMSB7k6DshryoZqlmGMbjt2g1nM7xOuwwfru1jC7t+qCBXL4PPBpHDhHzAW7u8tB8LQCU6GklIFa1+GoZbQ00BY/OoPbE3rxhxgGPAHXfYPLjGALIkYo9czeTO/zfcydHl5Xcyp/PsskSOUhNFcftxG+fQELb/oqc50ldBWlxBM/qU7fLI4KRfUag3J5sanCUsgiYdF0iQNfiYnUKLa9ThDHjHUQnB5EEt77cM2/DKQkyExMBBgYcRo9GzqyLXiDCYWVatCQU6rAD8NkBBpFs8W/0QXIV1J/S3DuZS3Eo4x27gRlT5YfUeO7jAZvwqy51WHNXwq13QTV2AOGfvpK3054sZm+10jdfAq6tgYdShQgO2kHRGP1q9vAC3SfD49mP9q+AemJrAkiR2HZTxkEQ+AttdfPhc2dzdLXp+ukQdqpL/xlywIp+KIim+YVjhO+Bi92rRn5Kl0h7q6MkpoTGI1F+akmNhD6VmB1Nd0G6e4AGTisuyd+vygEH7fsZhZuiMSknajfgPgazKiLUihwRvfk4FJm18Ju97tXcl6LhIJpkOcq7sI25GhWz0mHX1ErOf/949pcozo=</e:CipherValue>
-                        </e:CipherData>
-                </e:EncryptedKey>
-

+ 0 - 12
tests/Zend/InfoCard/_files/encryptedkey_missing_encryptionmethod.xml

@@ -1,12 +0,0 @@
-<e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
-                        <KeyInfo>
-                                <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
-                                        <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1"
-                                                                         EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">/OCqQ7Np25sOiA+4OsFh1R6qIeY=</o:KeyIdentifier>
-                                </o:SecurityTokenReference>
-                        </KeyInfo>
-                        <e:CipherData>
-                                <e:CipherValue>AIgtBEv9lGMikyHjV/b5mQ5LbLyupNtRH8hl5I6tJsZI5CYP32BLo9FgxAY5ZReEv+XZbqcs5KORBvTbMkP6l7MY32WJGPBDDMSB7k6DshryoZqlmGMbjt2g1nM7xOuwwfru1jC7t+qCBXL4PPBpHDhHzAW7u8tB8LQCU6GklIFa1+GoZbQ00BY/OoPbE3rxhxgGPAHXfYPLjGALIkYo9czeTO/zfcydHl5Xcyp/PsskSOUhNFcftxG+fQELb/oqc50ldBWlxBM/qU7fLI4KRfUag3J5sanCUsgiYdF0iQNfiYnUKLa9ThDHjHUQnB5EEt77cM2/DKQkyExMBBgYcRo9GzqyLXiDCYWVatCQU6rAD8NkBBpFs8W/0QXIV1J/S3DuZS3Eo4x27gRlT5YfUeO7jAZvwqy51WHNXwq13QTV2AOGfvpK3054sZm+10jdfAq6tgYdShQgO2kHRGP1q9vAC3SfD49mP9q+AemJrAkiR2HZTxkEQ+AttdfPhc2dzdLXp+ukQdqpL/xlywIp+KIim+YVjhO+Bi92rRn5Kl0h7q6MkpoTGI1F+akmNhD6VmB1Nd0G6e4AGTisuyd+vygEH7fsZhZuiMSknajfgPgazKiLUihwRvfk4FJm18Ju97tXcl6LhIJpkOcq7sI25GhWz0mHX1ErOf/949pcozo=</e:CipherValue>
-                        </e:CipherData>
-                </e:EncryptedKey>
-

File diff ditekan karena terlalu besar
+ 0 - 22
tests/Zend/InfoCard/_files/encryptedtoken.xml


File diff ditekan karena terlalu besar
+ 0 - 22
tests/Zend/InfoCard/_files/encryptedtoken2.xml


File diff ditekan karena terlalu besar
+ 0 - 22
tests/Zend/InfoCard/_files/encryptedtoken_bad_type.xml


+ 0 - 5
tests/Zend/InfoCard/_files/security_token_bad_keyref.xml

@@ -1,5 +0,0 @@
-				<o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
-					<o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1" 
-									 EncodingType="foo">/OCqQ7Np25sOiA+4OsFh1R6qIeY=</o:KeyIdentifier>
-				</o:SecurityTokenReference>
-

File diff ditekan karena terlalu besar
+ 0 - 0
tests/Zend/InfoCard/_files/signedToken.xml


File diff ditekan karena terlalu besar
+ 0 - 0
tests/Zend/InfoCard/_files/signedToken_bad_type.xml


+ 0 - 51
tests/Zend/InfoCard/_files/ssl_private.cert

@@ -1,51 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIJKAIBAAKCAgEAtmCinv4c2Y5oh7go62or4lQMJiM/oBJnRiA+7zqcvsbl4AYJ
-Ke3dEBz19i2kIL56GezMzeCyC89GsLQ1+0W8L2Ysyr1TyH8ZqVMjtL63utxkDXKE
-0NniQttijgkqfK7D4yH8TMiTu0WVoa1OU8vrSDe8KLF11pHEVWjb41MlJvK2eDea
-kbb96hU3Xcvfuuthd49TNZ45EbqgEuUMpJIpd9GnRPV+46jTbKHR6hkw/udm8X2g
-6nJ+5Nb3Ju7d972YsMnpO9jJ/0l/JYUXCOAEeJEGAaPLv+LsFlatP9FzJ5fXx5H6
-uf/u8ipHo5zVr6/1eI3I9BvEz/5wqxIRe6RvlN5DWdVvmBNnPur4rb5j8/7TVLaR
-7nMO1VSK3/roMXAGxwvcFV7/amHxWvHbDIw0AuBBfrjW92PKjrpIyER3scFzSNbd
-S3tdyylMsRahFEp1qjkcv6QlZWPZJzqdKZMb7TOI/lP+VWh/BkfCt9xo3bWOm1/u
-pKNANXeQl5AyQqzJ/xZdpZLDY3yG0+8e6YdBR+6gNnlYTcumZlYSHGPxTsXWW8Hn
-SsinMFxabH4uqXbVOQE0wY+xE7Q2ip6+RzovAsSTkSv2b5QinxOw4mSO3GdtlP8d
-MnS8uL/MNHN4/Zl41kbx96kct7QRPWN6S2crRqag+7kyDEDiKh2DoQr5bKkCAwEA
-AQKCAgBeo1a/2m1uF4/2nYHeZ4HOOH71a2Ug02vz39fInEmqVdwDnB41O9FzAxQ/
-Yv/AXhdOTKsaSncZ2b19BIbelRlKH2Mu8YAAkrPmQdZNfIoq1SK2N67kEaxvtRg3
-TFpXyPitbH1X+t1uWHWFKEF1CmRVXVauZygW6B1RlNBF7mdhBqHZUEFNTAAG8GuC
-qMC4Zlx1hlJPiINkx8s5AtLEs3QBUTHTfvERghH0VSRwrhHWtI2e0uolvrRKW6J0
-+Y8Fd8U8OApnm992MdVgyudhG542UksjnrOkJ0ULcn8EltOCwDCgxwesbTq5P2dd
-Z40bVduzax/UTHSc2hPtMbsQxgt/+7l6iIJ2CPuSRQORQQJf9Ar8b7qLf6aXK11O
-KO56gl4DcPlo5n19BdqkSMZ6zeJaJAe0UEhag4wkE1mpgPFVmm5av40zNQ1XnCJN
-D8RaA7tZHiXCkRXtmcInSzEIOJDEpBx53eCiOTci+TxBvX4BUo03r6hPdA8pxgRj
-PXKd+w5Mz/mj5UJHsf8OtCqBPaM+oRm8xLRSRRzwIx02QacUNO957y5weUtdscPE
-Y1+CRhxSEut8mjsn6vuuujM2w+v/sXHDqbB1QHDPbsbAXWX5d+1BuTu87tUsz24q
-/bjnIAk9qjW/XdfSmmcMIWi8AHgumVtItn8AcWHBnag+qyqtYQKCAQEA6kvGBAOr
-Q46rhIz70tjlFZXNdNFm62xqJwmYBzlOuHVzYtwnH1W471NZizkMh9Uvuhtsn9UM
-0nC7adsWqe6GHk0YoeR93HpEwI08smWWdGV0SYIMJPOQPQ9z8QjlzWBdGJwZKuXb
-VVqpvYH6FVJYTQIyb1tZ7kbMXkJZkabpCKOiT/7WSw9dN7Spbc8DuyJ68EIlJImD
-1z/j4UVjVfigs/6oUo83Uam623YETl1+DKF2lPVUBELwh6B3jdR+ujANGLGZ5NXB
-1jqvzZrbC1uMj5JPUcNDwjj7SDwQJ+7gSsq96pZ/dLYfT5o0Z5p+BvuYjarkoQuN
-QFfKC+gu19eeYwKCAQEAx0WjGWiQSUzHL5NVYtBdkmEdjF+rZ7OXL0cn/NywH/y3
-se+oJuySh3TMUgQxmz7oTH7k7pOhXqeiTEpOs3ItS47QSlnMdaIW/S215YQ5qk1r
-R9YxuqESKGpsL65+1likAGtvWazcZuY98eY04cSRsHanO165uMdSqFg6uoK2daB9
-6NQXX4EZsCT2/eaHuxqscQaVG1k+tnBYqZLHovqAsWadOTPTVNDXvuiyU1F1Uveo
-SudT98UUnVpxU/wktHzqP6eDU4CPBbREEXdpqIYvR4QeqkyTvnuVNGTigRtkPaJ9
-YsZ4epCBfd2pteu+2na/fWVc/2bR++MO9JEONP0ggwKCAQBuOoIJx3Qez5OQRAgB
-9bspgZXs3MvP/OygOxpEY8jObauAmlTpoBnmts8M+iUUDs9qfpaHR+PFafYyYjny
-bt64iMsK94XjYb7Q3GHvCG5VipnAL6fpBpIYuBlzEB2Vlz2VY3NPxF6BdKshFnKC
-73/NkzgJPfA8cyCZRBwBs4Y1Y07s1dcZ7zuLBrsjh16Y/yrZuDTjULMvZMagaFXI
-z7VDmY61cN201Oatc4OpHsE7zgcNI7KIYrnpBSzaFFwe2pZ+xKfDinGsiWXGlJFz
-cXna3hnlPLm3Obm3DVMIhpENfv8EzBNg5IIsoD8BcyTRwjLOi9UOk3G8ENFk8rJ/
-J9lDAoIBAB68AtfcZMSpbt9LnhPLh2MYT3JjHxCzhlHoa6Z4c0G7vKlZCVpXipIR
-1aGgu/Xx0epad/zEEFOFD2cs3s6WgZ3xvPZ6uyo5gcoyzqdDqZE2t6EwzCK4zRAm
-ueDwzOdKbKET8Oyn2KaWRF+W3fkkVEQfSNPDXGm/dGQ6l3REzNd/lWvfqms0gj3E
-tcObVrvo9UfJeB3rudxxn3soBFqCwG6cIQu9jo66V0w+n6JyIeJWCELlQvIoF3Hd
-jTUi4pZj3c1LjNnILkb28riu7kDr0Ub6fbBOd0sdzHl0Resbym4nLaeabOKafx5m
-ndJNNfaD8izpAVrzBNgQwTG/Xa2WjPkCggEBAIhTAdNmTNHpTymb3OksR81YNRIo
-+0Y2AMLXbYnOV0hshWlaiTtffPFUVrhbm+w6nCPimPknVCqjHvIvFyNQpqSOs5YX
-NwNmDtBiOQBcgmQ4Zd3K/JtvbXc6g1cHaa4ESP6X3d0VfH/y5RGHuo1rAlzvejfS
-i8mbstDw3lntc/7PACzbWzRKg4Hyc6m/08vhCG0HXgar9/neZP85Ur9YLgakcqDu
-AFcSPi9trTJVv3Wq6tEbyv1coORJA+CnCOhztMpM83DvEhqGjOtHeXRyC8EPJ2kj
-AlaoCXXh/ymc+I7SlXonCh9VwaDAErPWvIj5y6wJPKq4JHnIVzVAJ6iKAzY=
------END RSA PRIVATE KEY-----

+ 0 - 33
tests/Zend/InfoCard/_files/ssl_pub.cert

@@ -1,33 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIFxDCCA6wCAQEwDQYJKoZIhvcNAQEFBQAwgaQxCzAJBgNVBAYTAlVTMREwDwYD
-VQQIEwhOZXcgWW9yazEQMA4GA1UEBxMHQnVmZmFsbzEaMBgGA1UEChMRWmVuZCBU
-ZWNobm9sb2dpZXMxHjAcBgNVBAsTFVByb2Zlc3Npb25hbCBTZXJ2aWNlczEWMBQG
-A1UEAxMNMTkyLjE2OC4xLjEwNTEcMBoGCSqGSIb3DQEJARYNam9obkB6ZW5kLmNv
-bTAeFw0wNzA5MTgxNjQyNTdaFw0wODA5MTcxNjQyNTdaMIGqMQswCQYDVQQGEwJV
-UzERMA8GA1UECBMITmV3IFlvcmsxEDAOBgNVBAcTB0J1ZmZhbG8xIDAeBgNVBAoT
-F1plbmQgVGVjaG5vbG9naWVzLCBJbmMuMR4wHAYDVQQLExVQcm9mZXNzaW9uYWwg
-U2VydmljZXMxFjAUBgNVBAMTDTE5Mi4xNjguMS4xMDUxHDAaBgkqhkiG9w0BCQEW
-DWpvaG5AemVuZC5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2
-YKKe/hzZjmiHuCjraiviVAwmIz+gEmdGID7vOpy+xuXgBgkp7d0QHPX2LaQgvnoZ
-7MzN4LILz0awtDX7RbwvZizKvVPIfxmpUyO0vre63GQNcoTQ2eJC22KOCSp8rsPj
-IfxMyJO7RZWhrU5Ty+tIN7wosXXWkcRVaNvjUyUm8rZ4N5qRtv3qFTddy9+662F3
-j1M1njkRuqAS5Qykkil30adE9X7jqNNsodHqGTD+52bxfaDqcn7k1vcm7t33vZiw
-yek72Mn/SX8lhRcI4AR4kQYBo8u/4uwWVq0/0XMnl9fHkfq5/+7yKkejnNWvr/V4
-jcj0G8TP/nCrEhF7pG+U3kNZ1W+YE2c+6vitvmPz/tNUtpHucw7VVIrf+ugxcAbH
-C9wVXv9qYfFa8dsMjDQC4EF+uNb3Y8qOukjIRHexwXNI1t1Le13LKUyxFqEUSnWq
-ORy/pCVlY9knOp0pkxvtM4j+U/5VaH8GR8K33GjdtY6bX+6ko0A1d5CXkDJCrMn/
-Fl2lksNjfIbT7x7ph0FH7qA2eVhNy6ZmVhIcY/FOxdZbwedKyKcwXFpsfi6pdtU5
-ATTBj7ETtDaKnr5HOi8CxJORK/ZvlCKfE7DiZI7cZ22U/x0ydLy4v8w0c3j9mXjW
-RvH3qRy3tBE9Y3pLZytGpqD7uTIMQOIqHYOhCvlsqQIDAQABMA0GCSqGSIb3DQEB
-BQUAA4ICAQCiBzdsthUHuCv5ec8r/yH93l3fRkoIEh1ZZAycnLjTC5rKZvRlWAXu
-VKs7ViauRSt4dth6MTGmCZO6Lv3uO4G/YmvwcANYVOl0z7DoC0QCccmRtGcGHWt/
-jciQgqvoUe+d5JHQeU9AtclLXSIIbQr9FtlBYdaPHjq+6AXtKgy+Gzo8lQITcqh9
-OBODgIvt6O/rILg26G4Ud/X1aJbfD3xCrwNMs0FQMnnl9mFyNO3ZZPtbGcuaVQTJ
-w3immpFZQloqh6W5/+0OBAXmdz/LQITomUjajTBsoEJIgT6qTIniPLb2oxgw4dcM
-p3ECXNc7S6xO41ky1jsN9NDCeY8OL3zaXjN0cdUVfWTCbUeVQ9K4cq6NeUCNko21
-pa+N6vsZYXUBNqvvDWwGqstZIwnE0awZ9UX6hfK+AqdNWIoBTcclmTQCgS3JWuXP
-p1u8N5wTyAsxiEmJhMPOZSgj1i+OgPrh3zaAc84WtXk6BKVsMK1Yo0lu55tVrMI0
-sa00deH3HTxrtVWKmwfmfwZEjMmwd8YJEhmYcOr5hgB9/cS0b3svSJnQCifrYNg0
-PmTZprqmalzFdTmsFeogCx79f9yDEmFrw3/UZFeF/+4GHMbBzTHPYvwdKZFPXHma
-EHOj/mkX+lt19SkiPzg9rDNaCF2SyvBH1lQWCRNn1yPivpWdcxIF9A==
------END CERTIFICATE-----

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini