- if( rest == "key" ) {
- profiles[i].key = value;
- } else if( rest == "cert" ) {
- profiles[i].cert = value;
- } else if( rest == "ku" ) {
- profiles[i].ku = value;
- } else if( rest == "eku" ) {
- profiles[i].eku = value;
+ Profile prof;
+ prof.id = std::stoi( id );
+ prof.eku = map->at( "eku" );
+ prof.ku = map->at( "ku" );
+ prof.maxValidity = std::stoi( map->at( "days" ) ) * /* DAYS */24 * 60 * 60;
+
+ std::string cas = map->at( "ca" );
+
+ for( size_t pos = 0; pos != std::string::npos; ) {
+ size_t end = cas.find( ",", pos );
+ std::string sub;
+
+ if( end == std::string::npos ) {
+ sub = cas.substr( pos );