+ DIR *dir;
+ struct dirent *ent;
+
+ if( profileName == "0100-ocsp" ) {
+ //This profile does not have a specific CA. The concrete CA has to be set in each request.
+ } else if( ( dir = opendir( "ca" ) ) != NULL ) {
+ std::string cas = map->at( "ca" );
+ std::string toFind = cas + "_";
+
+ while( ( ent = readdir( dir ) ) != NULL ) {
+ std::string caName = std::string( ent->d_name );
+
+ if( caName.find( toFind ) != 0 ) {
+ continue;
+ }
+
+ if( CAs.find( caName ) == CAs.end() ) {
+ auto ca = std::make_shared<CAConfig>( caName );
+ CAs.emplace( caName, ca );
+ }
+
+ prof.ca.push_back( CAs.at( caName ) );
+ logger::note( "Adding CA: ", caName );
+ }
+
+ closedir( dir );
+ } else {
+ throw std::runtime_error( "Directory with CAConfigs not found" );
+ }