示例#1
0
 /**
  * Tests OpenSSL::createProcess
  *
  * @expectedException \phpbu\App\Exception
  */
 public function testNoMode()
 {
     $path = realpath(__DIR__ . '/../../../_files/bin');
     $openSSL = new OpenSSL($path);
     $openSSL->encryptFile('/foo/bar.txt');
     $openSSL->getCommandLine();
 }
示例#2
0
 /**
  * Returns the correct AES-128 CBC encryption adapter
  *
  * @return  AKEncryptionAESAdapterInterface
  *
  * @since   5.2.0
  * @author  Nicholas K. Dionysopoulos
  */
 public static function getAdapter()
 {
     static $adapter = null;
     if (is_object($adapter) && $adapter instanceof AKEncryptionAESAdapterInterface) {
         return $adapter;
     }
     $adapter = new OpenSSL();
     if (!$adapter->isSupported()) {
         $adapter = new Mcrypt();
     }
     return $adapter;
 }
示例#3
0
 /**
  * Resets the OpenSSL error stack.
  *
  * @since 0.3
  */
 public static function resetErrors()
 {
     OpenSSL::isAvailable(true);
     while (openssl_error_string()) {
     }
 }