/** * 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(); }
/** * 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; }
/** * Resets the OpenSSL error stack. * * @since 0.3 */ public static function resetErrors() { OpenSSL::isAvailable(true); while (openssl_error_string()) { } }