Exemple #1
0
 public function testPKIDecryptThrowsExceptionOnBadKey()
 {
     if (!extension_loaded('openssl')) {
         $this->markTestSkipped('The openssl extension is not loaded.');
     }
     $obj = new Adapter\RSA();
     $this->setExpectedException('Zend\\InfoCard\\Cipher\\Exception\\RuntimeException', 'Failed to load private key');
     $obj->decrypt("Foo", "bar");
 }
Exemple #2
0
 public function testPKIDecryptBadKey()
 {
     if (!extension_loaded('openssl')) {
         $this->markTestSkipped('The openssl extension is not loaded.');
     }
     $obj = new Adapter\RSA();
     try {
         $obj->decrypt("Foo", "bar");
         $this->fail("Exception not thrown as expected");
     } catch (\Exception $e) {
         /* yay */
     }
 }