phpseclib\Crypt\RC4::isValidEngine PHP Method

isValidEngine() public method

This is mainly just a wrapper to set things up for \phpseclib\Crypt\Common\SymmetricKey::isValidEngine()
See also: phpseclib\Crypt\Common\SymmetricKey::__construct()
public isValidEngine ( integer $engine ) : boolean
$engine integer
return boolean
    function isValidEngine($engine)
    {
        switch ($engine) {
            case self::ENGINE_OPENSSL:
                switch (strlen($this->key)) {
                    case 5:
                        $this->cipher_name_openssl = 'rc4-40';
                        break;
                    case 8:
                        $this->cipher_name_openssl = 'rc4-64';
                        break;
                    case 16:
                        $this->cipher_name_openssl = 'rc4';
                        break;
                    default:
                        return false;
                }
        }
        return parent::isValidEngine($engine);
    }