Beispiel #1
0
 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 testPlugins()
    {
        $adapter  = new _Zend_InfoCard_Test_Adapter();
        $infoCard = new Zend_InfoCard();

        $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());
    }