* @return void
*/
protected function attachCryptoStream () {
- // Do we have mcrypt loaded?
+ // @TODO Maybe rewrite this with DirectoryIterator, similar to Compressor thing?
+ // Do we have openssl/mcrypt loaded?
if ($this->isPhpExtensionLoaded('mcrypt')) {
// Then use it
- $this->cryptoStreamInstance = ObjectFactory::createObjectByName('McryptStream', array($this->getRngInstance()));
+ $this->cryptoStreamInstance = ObjectFactory::createObjectByName('CoreFramework\Stream\Crypto\McryptStream', array($this->getRngInstance()));
+ } elseif ($this->isPhpExtensionLoaded('openssl')) {
+ // Then use it
+ $this->cryptoStreamInstance = ObjectFactory::createObjectByName('CoreFramework\Stream\Crypto\OpenSslStream', array($this->getRngInstance()));
} else {
// If nothing works ...
- $this->cryptoStreamInstance = ObjectFactory::createObjectByName('NullCryptoStream');
+ $this->cryptoStreamInstance = ObjectFactory::createObjectByName('CoreFramework\Stream\Crypto\NullCryptoStream');
}
}