Ejemplo n.º 1
0
Certificate* CertificateManager::readCredentialsFromFile(const path &file, bool resolve) {
  X509 *cert    = loadCertificateFromFile(system_complete(file).string().c_str());
  EVP_PKEY *key = loadKeyFromFile(system_complete(file).string().c_str());

  if (!cert || !key) throw BadCertificateException();

  return new Certificate(cert, key, resolve);
}
Ejemplo n.º 2
0
Dataset::Dataset(string str): root(str){
  path full_path =  system_complete(root);
  directory_iterator end_itr;
  size_t label = 0;
  if(is_directory(full_path)){
    try{
      for (directory_iterator itr( full_path ); itr != end_itr;++itr ){
	if(is_directory(itr->path())){
	  string root, descriptor, catname;
	  root = (string) itr->path().string().c_str();
	  catname = (string) itr->path().filename().c_str();
	  vector<DataPoint> dps = getDataPoints(itr->path(), label, catname);
	  Category newcat(catname, root, label, dps);
	  category_names[label] = catname;
	  if(newcat.size() > 10){
	    addCategory(newcat);
	    label++;
	  }
	}
      }
    }
    catch(...){
    }
  } 
}