Set the location of the CA cert file for the CAS server.

@param string $ca_file

@throws Exception
979625
private function setCasCaCertPath($ca_file)
    {
        if ($ca_file === 'none') {
            phpCAS::setNoCasServerValidation();
        } else {
            if (file_exists($ca_file) && is_readable($ca_file)) {
                phpCAS::setCasServerCACert($ca_file);
            } else {
                throw new Exception("Unable to read CAS CA-Cert file: " . $ca_file, 500);
            }
        }
    }
784540
public function get($remote_file, $local_file, $mode = null)
    {
        $mode = $mode ? $mode : FTP_ASCII;
        if (!@ftp_get($this->connection, $local_file, $remote_file, $mode)) {
            throw new \Exception("Could not get remote file:" . $remote_file);
        }

        return true;
    }
429348
def gen_ca_cert(filename, dirname, days, silent=False):
    
    keyfile = os.path.join(dirname, '{}.key'.format(filename))
    ca_crt = os.path.join(dirname, '{}.crt'.format(filename))
    gen_private_key(keyfile, silent)
    gen_self_signed_cert(ca_crt, keyfile, days, silent)
371163
private function rollbackOpeningFile($temp_file = null)
    {
        flock($this->getFile(), LOCK_UN);
        fclose($this->getFile());
        if(is_resource($temp_file))
        {
            fclose($temp_file);
            unlink($this->getTempFilePath());
        }
    }
1191317
public static function setCasServerCACert($cert, $validate_cn = true)
    {
        phpCAS :: traceBegin();
        phpCAS::_validateClientExists();

        try {
            self::$_PHPCAS_CLIENT->setCasServerCACert($cert, $validate_cn);
        } catch (Exception $e) {
            phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
        }

        phpCAS :: traceEnd();
    }
705120
public function setSrcfile($file)
    {
        if (is_string($file)) {
            $file = new PhingFile($file);
        }
        $this->_sourceFile = $file;
    }
1259282
public function setFileLock($file_lock)
    {
        if (empty($file_lock) && $file_lock !== false) {
            throw new PageCacheException(__CLASS__ . ' file lock can not be empty. To disable set to boolean false.');
        }
        $this->file_lock = $file_lock;
    }
504732
public static function setPGTStorageFile($path = '')
    {
        phpCAS :: traceBegin();
        phpCAS::_validateProxyExists();

        try {
            self::$_PHPCAS_CLIENT->setPGTStorageFile($path);
        } catch (Exception $e) {
            phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
        }
        phpCAS :: traceEnd();
    }
32235
def set_client_cert_file(cert_file, key_file)
    @client_cert = OpenSSL::X509::Certificate.new(File.open(cert_file).read)
    @client_key = OpenSSL::PKey::RSA.new(File.open(key_file).read)
    change_notify
  end
341020
function setTemplateFile($file){
		$this->_template->setTemplateFile(ROOT . DS . 'application' . DS . 'views' . DS . $file);
		
	}
611620
public function load($data_folder = '')
  {
    $loader = new DataLoader();
    $this->data = $loader->load($data_folder, '/config.json');
    if (!$this->validator->validate($this->data)) {
      throw new \Exception('Config.json fail.');
    }
  }
1370806
def validate(cert, ca_name, crl_file):
    '''
    
    '''
    store = OpenSSL.crypto.X509Store()
    cert_obj = _read_cert(cert)
    if cert_obj is None:
        raise CommandExecutionError(
            'Failed to read cert from {0}, see log for details'.format(cert)
        )
    ca_dir = '{0}/{1}'.format(cert_base_path(), ca_name)
    ca_cert = _read_cert('{0}/{1}_ca_cert.crt'.format(ca_dir, ca_name))
    store.add_cert(ca_cert)
    # These flags tell OpenSSL to check the leaf as well as the
    # entire cert chain.
    X509StoreFlags = OpenSSL.crypto.X509StoreFlags
    store.set_flags(X509StoreFlags.CRL_CHECK | X509StoreFlags.CRL_CHECK_ALL)
    if crl_file is None:
        crl = OpenSSL.crypto.CRL()
    else:
        with salt.utils.files.fopen(crl_file) as fhr:
            crl = OpenSSL.crypto.load_crl(OpenSSL.crypto.FILETYPE_PEM, fhr.read())
    store.add_crl(crl)
    context = OpenSSL.crypto.X509StoreContext(store, cert_obj)
    ret = {}
    try:
        context.verify_certificate()
        ret['valid'] = True
    except OpenSSL.crypto.X509StoreContextError as e:
        ret['error'] = str(e)
        ret['error_cert'] = e.certificate
        ret['valid'] = False
    return ret
510208
public function setTemplateFile(string $sRelativePathToFile) : void
  {
    if(!is_file($sRelativePathToFile)) {
      throw new \Exception('Template file not found.');
    }
    
    $sFileContent = file_get_contents($sRelativePathToFile);
    $this->setTemplate($sFileContent);
  }
224434
public void setCertificateChainFile(Path certificateChainFile)
  {
    try {
      _certificateChainFile = certificateChainFile.toRealPath().toString();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
1215361
public function setCertificate($certificateFile, $password = null)
    {
        if ($password) {
            $this->options[GuzzleRequestOptions::CERT] = [$certificateFile, $password];
        } else {
            $this->options[GuzzleRequestOptions::CERT] = $certificateFile;
        }
    }
907775
public static void saveCertificate(X509Certificate cert, File targetFile) {
        File folder = targetFile.getAbsoluteFile().getParentFile();
        if (!folder.exists()) {
            folder.mkdirs();
        }
        File tmpFile = new File(folder, Long.toHexString(System.currentTimeMillis()) + ".tmp");
        try {
            boolean asPem = targetFile.getName().toLowerCase().endsWith(".pem");
            if (asPem) {
                // PEM encoded X509
                PEMWriter pemWriter = null;
                try {
                    pemWriter = new PEMWriter(new FileWriter(tmpFile));
                    pemWriter.writeObject(cert);
                    pemWriter.flush();
                } finally {
                    if (pemWriter != null) {
                        pemWriter.close();
                    }
                }
            } else {
                // DER encoded X509
                FileOutputStream fos = null;
                try {
                    fos = new FileOutputStream(tmpFile);
                    fos.write(cert.getEncoded());
                    fos.flush();
                } finally {
                    if (fos != null) {
                        fos.close();
                    }
                }
            }

            // rename tmp file to target
            if (targetFile.exists()) {
                targetFile.delete();
            }
            tmpFile.renameTo(targetFile);
        } catch (Exception e) {
            if (tmpFile.exists()) {
                tmpFile.delete();
            }
            throw new RuntimeException("Failed to save certificate " + cert.getSubjectX500Principal().getName(), e);
        }
    }
1232633
public function setRemoteFilename(string $name) : void
    {
        if (empty($name)) {
            throw new Exception(
                'the filename can not be empty',
                Exception::INI_FILE_MISSING
            );
        }

        $this->remoteFilename = $name;
    }