os/security/securityanddataprivacytools/securitytools/certapp/test/tcertapp/goodconfigwriter.cpp
First public contribution.
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #include "goodconfigwriter.h"
23 #include "tcertapp_good.h"
25 // Array for the StatCA- holds all relevant details
26 const char *swicertemu_array[]=
29 "c7014670ad9c8ac296c2ae665c4e78f3d4df4a99"
32 const char *cert_array[]=
36 "7ce306295116207214d425affd185b6d5e48af6f",
41 // uids required for cacerts
42 const char *emu_cacertsUid[]=
50 Class required to create files to write data
52 GoodConfigWriter::GoodConfigWriter(const std::stringstream &aFileName)
54 std::string name = aFileName.str();
55 iFile.open(name.c_str(), std::ios_base::trunc | std::ios_base::out);
58 std::cout << "Failed to open '" << name.c_str()<< "' for output!" << std::endl;
63 GoodConfigWriter::~GoodConfigWriter()
69 Class definition for creating cacerts config files
71 FileCertStoreConfigWriter::FileCertStoreConfigWriter(const std::stringstream &aFileName)
72 : GoodConfigWriter(aFileName), iEntryCount(0)
74 iFile << "StartCertStoreEntries" << std::endl;
77 FileCertStoreConfigWriter::~FileCertStoreConfigWriter()
79 iFile << "EndCertStoreEntries" << std::endl;
82 void FileCertStoreConfigWriter::WriteExtraFileEntry()
84 iFile << "\tStartEntry " << "\"AugmentData\"" << std::endl;
85 iFile << "\t\tDeletable " << "\"true\"" << std::endl;
86 iFile << "\t\tFormat " << "\"EX509Certificate\"" << std::endl;
87 iFile << "\t\tCertOwnerType " << "\"ECACertificate\"" << std::endl;
88 iFile << "\t\tSubjectKeyId " << "auto" << std::endl;
89 iFile << "\t\tIssuerKeyId " << "auto" << std::endl;
90 iFile << "\t\tStartApplicationList" << std::endl;
91 iFile << "\t\t\t#Entry 1" << std::endl;
92 iFile << "\t\t\t\tApplication " << "\"0x100042ab\"" << std::endl;
93 iFile << "\t\t\t\tApplication " << "\"0x1000a8b6\"" << std::endl;
94 iFile << "\t\tEndApplicationList" << std::endl;
95 iFile << "\t\tTrusted " << "\"true\"" << std::endl;
96 iFile << "\t\tDataFileName " << "\"cert0.der\"" << std::endl;
97 iFile <<"\tEndEntry" <<std::endl;
100 void FileCertStoreConfigWriter::WriteFileEntry(const char *aGoodLabel,
101 const char *aGoodDeletable,
102 const char *aGoodFormat,
103 const char *aGoodCertOwnerType,
104 const char *aGoodSubjectKeyId,
105 const char *aGoodIssuerKeyId,
106 const char *aGoodApplication,
107 const char *aGoodTrusted,
108 const char *aGoodDataFileName)
111 // Setup default values
114 aGoodDeletable = "\"true\"";
116 if(!aGoodFormat) aGoodFormat = "\"EX509Certificate\"";
117 if(!aGoodCertOwnerType) aGoodCertOwnerType = "\"ECACertificate\"";
118 if(!aGoodSubjectKeyId) aGoodSubjectKeyId = "auto";
119 if(!aGoodIssuerKeyId) aGoodIssuerKeyId = "auto";
120 if(!aGoodApplication) aGoodApplication = "\"Server Authentication\"";
121 if(!aGoodTrusted) aGoodTrusted = "\"true\"";
123 iFile << "\t# Entry " << iEntryCount << std::endl;
124 iFile << "\tStartEntry " << aGoodLabel <<std::endl;
125 iFile << "\t\tDeletable " << aGoodDeletable << std::endl;
126 iFile << "\t\tFormat " << aGoodFormat << std::endl;
127 iFile << "\t\tCertOwnerType " << aGoodCertOwnerType << std::endl;
128 iFile << "\t\tSubjectKeyId " << aGoodSubjectKeyId << std::endl;
129 iFile << "\t\tIssuerKeyId " << aGoodIssuerKeyId << std::endl;
130 iFile << "\t\tStartApplicationList" << std::endl;
131 // write down the applications
132 for(int i = 0; i<2; i++)
134 iFile << "\t\t\t# Entry " << i << std::endl;
135 iFile << "\t\t\t\tApplication " << goodApplications[i]<< std::endl;
137 iFile << "\t\tEndApplicationList" << std::endl;
138 iFile << "\t\tTrusted " << aGoodTrusted << std::endl;
139 iFile << "\t\tDataFileName " << aGoodDataFileName << std::endl;
140 iFile <<"\tEndEntry" <<std::endl;
144 Class definition for generating certclient configuration files
146 FileCertClientConfigWriter::FileCertClientConfigWriter(const std::stringstream &aFileName)
147 : GoodConfigWriter(aFileName),iEntryCount(0)
149 iFile << "StartClientInfo" << std::endl;
152 FileCertClientConfigWriter::~FileCertClientConfigWriter()
154 iFile << "EndClientInfo" << std::endl;
157 void FileCertClientConfigWriter::WriteCertClientName(const char *aGoodAppName)
159 iFile << "\t\tName "<< aGoodAppName << std::endl;
162 void FileCertClientConfigWriter::WriteCertClientUid(const char *aGoodUid)
165 iFile << "\t#Entry "<< iEntryCount << std::endl;
166 iFile << "\t\tUid "<< aGoodUid << std::endl;
169 void FileCertClientConfigWriter::WriteExtraCertClientEntry()
171 iFile << "\t#Entry "<< iEntryCount << std::endl;
172 iFile << "\t\tUid "<< "0x12345678" << std::endl;
173 iFile << "\t\tName "<< "Augment_Label" << std::endl;
177 Swi certstore config writer
179 SwiCertStoreConfigWriter::SwiCertStoreConfigWriter(const std::stringstream &aFileName)
180 : GoodConfigWriter(aFileName), iEntryCount(0)
182 iFile <<"StartSwiCertStoreEntries" << std::endl;
185 SwiCertStoreConfigWriter::~SwiCertStoreConfigWriter()
187 iFile << "EndSwiCertStoreEntries" << std::endl;
190 void SwiCertStoreConfigWriter::WriteExtraSwiEntry()
192 iFile << "\tStartEntry " << "\"AugmentData\"" << std::endl;
193 iFile << "\t\tFormat " << "\"EX509Certificate\"" << std::endl;
194 iFile << "\t\tCertOwnerType " << "\"ECACertificate\"" << std::endl;
195 iFile << "\t\tSubjectKeyId " << "auto" << std::endl;
196 iFile << "\t\tIssuerKeyId " << "auto" << std::endl;
197 iFile << "\t\tStartApplicationList" << std::endl;
198 iFile << "\t\t\t# Entry 1" << std::endl;
199 iFile << "\t\t\t\tApplication " << "0x1000aaaa" << std::endl;
200 iFile << "\t\tEndApplicationList" << std::endl;
201 iFile << "\t\tTrusted " << "true" << std::endl;
202 iFile << "\t\tDataFileName " << "\"swicertstore_cert0.der\"" << std::endl;
203 iFile << "\t\tCapabilitySet " << "{ TCB LocalServices }";
204 iFile << "\t\tMandatory " << "true" << std::endl;
205 iFile << "\t\tSystemUpgrade " << "false"<< std::endl;
206 iFile <<"\tEndEntry" <<std::endl;
210 void SwiCertStoreConfigWriter::WriteSwiEntry(const char *aGoodLabel,
211 const char *aGoodFormat,
212 const char *aGoodCertOwnerType,
213 const char *aGoodSubjectKeyId,
214 const char *aGoodIssuerKeyId,
215 const char *aGoodApplication,
216 const char *aGoodTrusted,
217 const char *aGoodCapabilitySets,
218 const char *aGoodMandatory,
219 const char *aGoodSystemUpgrade)
222 // Setup default values
223 if(!aGoodFormat) aGoodFormat = "\"EX509Certificate\"";
224 if(!aGoodCertOwnerType) aGoodCertOwnerType = "ECACertificate";
225 if(!aGoodSubjectKeyId) aGoodSubjectKeyId = "auto";
226 if(!aGoodIssuerKeyId) aGoodIssuerKeyId = "auto";
227 if(!aGoodApplication) aGoodApplication = "\"Server Authentication\"";
228 if(!aGoodTrusted) aGoodTrusted = "\"true\"";
229 if(!aGoodCapabilitySets) aGoodCapabilitySets = "TCB";
230 if(!aGoodMandatory) aGoodMandatory = "\"true\"";
231 if(!aGoodSystemUpgrade) aGoodSystemUpgrade = "\"true\"";
233 iFile << "\t#Entry " << iEntryCount << std::endl;
234 iFile << "\tStartEntry " << aGoodLabel << std::endl;
235 iFile << "\t\tFormat " << aGoodFormat << std::endl;
236 iFile << "\t\tCertOwnerType " << aGoodCertOwnerType << std::endl;
237 iFile << "\t\tSubjectKeyId " << aGoodSubjectKeyId << std::endl;
238 iFile << "\t\tIssuerKeyId " << aGoodIssuerKeyId << std::endl;
239 iFile << "\t\tStartApplicationList" << std::endl;
241 for(int k = 0; k<2 ; k++)
243 iFile << "\t\t\t# Entry " << k << std::endl;
244 iFile << "\t\t\t\tApplication " << goodUids[k] << std::endl;
246 iFile << "\t\tEndApplicationList" << std::endl;
247 iFile << "\t\tTrusted " << aGoodTrusted << std::endl;
248 iFile << "\t\tDataFileName " << "\"swicertstore_cert0.der\"" << std::endl;
249 iFile << "\t\tCapabilitySet " << "{ ";
250 for(int i = 0; i< 20; i++)
252 iFile << goodCapabilitySets[i];
255 iFile <<"}" <<std::endl;
256 iFile << "\t\tMandatory " << aGoodMandatory << std::endl;
257 iFile << "\t\tSystemUpgrade " << aGoodSystemUpgrade << std::endl;
258 iFile << "\tEndEntry" << std::endl;
262 //Script and INI file generator
263 ScriptAndIniGeneration::ScriptAndIniGeneration(const std::stringstream &aFileName)
264 : GoodConfigWriter(aFileName)
266 int last_dot = aFileName.str().rfind('.');
269 iIniFileName = aFileName.str().substr(0,last_dot);
270 iIniFileName.append(".ini");
271 iIniFile.open(iIniFileName.c_str(), std::ios_base::trunc | std::ios_base::out);
274 std::cout << "Failed to open '" << iIniFileName.c_str()<< "' for output!" << std::endl;
280 ScriptAndIniGeneration::~ScriptAndIniGeneration()
285 void ScriptAndIniGeneration::WriteTestCaseToScript(const std::stringstream &aTestCaseType,int &aTestIndex,const char *aTestActionName,const char *aTestActionType,bool aHasActionBody)
287 // set test case ID string
288 char testCaseIndexBuffer[6];
289 sprintf(testCaseIndexBuffer, "-%04d", aTestIndex);
291 iFile << "START_TESTCASE " << aTestCaseType.str() << testCaseIndexBuffer << std::endl;
292 iFile << "//! @SYMTestCaseID " << aTestCaseType.str() << testCaseIndexBuffer << std::endl;
293 iFile << "//! @SYMTestCaseDesc " << aTestActionName << std::endl;
294 iFile << "RUN_TEST_STEP -1\tCTestHandler\t" << aTestActionType;
297 iFile << "\t" << iIniFileName << "\t" << aTestCaseType.str() << testCaseIndexBuffer << "-001";
298 iIniFile << "[" << aTestCaseType.str() << testCaseIndexBuffer << "-001" << "]" << std::endl;
301 iFile << "END_TESTCASE " << aTestCaseType.str() << testCaseIndexBuffer << std::endl;
306 FileStoreScriptGeneration::FileStoreScriptGeneration(const std::stringstream &aFileName)
307 : ScriptAndIniGeneration(aFileName)
312 FileStoreScriptGeneration::~FileStoreScriptGeneration()
316 void FileStoreScriptGeneration:: WriteInitialiseCert(const char *aMode, const std::stringstream &aTestCaseType, int &aTestIndex)
318 const char *testcasename = "Initializing a CUnifiedCertStore";
319 const char *testcasetype = "init";
320 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
321 iIniFile << "<actionbody>" << std::endl;
322 iIniFile << "\t<mode>" << aMode << "</mode>" << std::endl;
323 iIniFile << "</actionbody>" << std::endl;
324 iIniFile << std::endl;
329 void FileStoreScriptGeneration::WriteListcert(const char *aGoodOwnerType, const std::stringstream &aTestCaseType, int &aTestIndex)
331 const char *testcasename = "Get the list of certificates";
332 const char *testcasetype = "listcert";
333 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
334 iIniFile << "<actionbody>" << std::endl;
335 iIniFile << "\t<filter>" << std::endl;
336 iIniFile << "\t\t<ownertype>" << aGoodOwnerType << "</ownertype>" << std::endl;
337 iIniFile << "\t</filter>" << std::endl;
338 iIniFile << "</actionbody>" << std::endl;
339 iIniFile << "<actionresult>" << std::endl;
340 for(int z =0; z<6; z++)
342 iIniFile << "\t<CCTCertInfo><label>" << goodEmuCert_array[z] << "</label></CCTCertInfo>" << std::endl;
344 iIniFile << "</actionresult>" << std::endl;
345 iIniFile << std::endl;
348 void FileStoreScriptGeneration::WriteGetCertificateDetails(const char *label, const std::stringstream &aTestCaseType, int &aTestIndex)
350 const char *testcasename = "Get certificate details";
351 const char *testcasetype = "listcert";
352 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
354 iIniFile << "<actionbody>" << std::endl;
355 iIniFile << "\t<filter>" << std::endl;
356 iIniFile << "\t\t<label>" << label << "</label>" << std::endl;
357 iIniFile << "\t\t<format>" << cert_array[i++]<< "</format>" << std::endl;
358 iIniFile << "\t\t<certowner>" << cert_array[i++] << "</certowner>" << std::endl;
359 iIniFile << "\t\t<subjectkeyid>" << cert_array[i++] << "</subjectkeyid>" << std::endl;
360 iIniFile << "\t\t<issuerkeyid>" <<cert_array[i++] << "</issuerkeyid>" << std::endl;
361 iIniFile << "\t\t<deletable>" << cert_array[i++] << "</deletable>" << std::endl;
362 iIniFile << "\t</filter>" << std::endl;
363 iIniFile << "</actionbody>" << std::endl;
364 iIniFile << "<actionresult>" << std::endl;
365 iIniFile << "\t<CCTCertInfo><label>" << label << "</label></CCTCertInfo>" << std::endl;
366 iIniFile << "</actionresult>" << std::endl;
367 iIniFile << std::endl;
371 void FileStoreScriptGeneration::WriteGetTrust(const char *label, const char *trust, const std::stringstream &aTestCaseType, int &aTestIndex)
373 const char *testcasename = "Get Trust certificate";
374 const char *testcasetype = "gettrusters";
375 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
376 iIniFile << "<actionbody>" << std::endl;
377 iIniFile << "\t<label>" << label << "</label>" << std::endl;
378 iIniFile << "</actionbody>" << std::endl;
379 iIniFile << "<actionresult>" << std::endl;
380 iIniFile << "\t<trust>" << trust << "</trust>" << std::endl;
381 iIniFile << "</actionresult>" << std::endl;
382 iIniFile << std::endl;
386 void FileStoreScriptGeneration::WriteGetApplications(const char *label, const std::stringstream &aTestCaseType, int &aTestIndex)
388 const char *testcasename = "Get applications";
389 const char *testcasetype = "getapplications";
390 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
391 iIniFile << "<actionbody>" << std::endl;
392 iIniFile << "\t<label>" << label << "</label>" << std::endl;
393 iIniFile << "</actionbody>" << std::endl;
394 iIniFile << "<actionresult>" << std::endl;
395 iIniFile << "\t<uid>";
396 for(int j = 0; j<2; j++)
398 iIniFile << emu_cacertsUid[j] << " ";
400 iIniFile << "</uid>" << std::endl;
401 iIniFile << "</actionresult>" << std::endl;
402 iIniFile << std::endl;
406 void FileStoreScriptGeneration::WriteRetrieveCerts(const char *label, const std::stringstream &aTestCaseType, int &aTestIndex)
408 const char *testcasename = "Retrieve Certificate";
409 const char *testcasetype = "retrieve";
410 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
411 iIniFile << "<actionbody>" << std::endl;
412 iIniFile << "\t<label>" << label << "</label>" << std::endl;
413 iIniFile << "</actionbody>" << std::endl;
414 iIniFile << std::endl;
419 //Swi store script generator for emulator tests
420 SWIStoreScriptGeneration::SWIStoreScriptGeneration(const std::stringstream &aFileName)
421 : ScriptAndIniGeneration(aFileName)
426 SWIStoreScriptGeneration::~SWIStoreScriptGeneration()
430 void SWIStoreScriptGeneration:: WriteInitialiseCert(const std::stringstream &aTestCaseType, int &aTestIndex)
432 const char *testcasename = "Initialise a SWICertStore";
433 const char *testcasetype = "initswicertstore";
434 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype, false);
438 void SWIStoreScriptGeneration::WriteListcert(const char *aGoodOwnerType, const std::stringstream &aTestCaseType, int &aTestIndex)
440 const char *testcasename = "Get the list of certificates";
441 const char *testcasetype = "listcert";
442 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
443 iIniFile << "<actionbody>" << std::endl;
444 iIniFile << "\t<filter>" << std::endl;
445 iIniFile << "\t\t<ownertype>" << aGoodOwnerType << "</ownertype>" << std::endl;
446 iIniFile << "\t</filter>" << std::endl;
447 iIniFile << "</actionbody>" << std::endl;
448 iIniFile << "<actionresult>" << std::endl;
449 for(int i =0; i<6; i++)
451 iIniFile << "\t<CCTCertInfo><label>" << goodSwiCert_array[i] << "</label><readonly>True</readonly></CCTCertInfo>" << std::endl;
453 iIniFile << "</actionresult>" << std::endl;
454 iIniFile << std::endl;
457 void SWIStoreScriptGeneration::WriteGetSystemUpgrade(const char *label, const char *aSystemUpgrade, const std::stringstream &aTestCaseType, int &aTestIndex)
459 const char *testcasename = "Get the systemupgrade flag";
460 const char *testcasetype = "getsystemupgrade";
461 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
462 iIniFile << "<actionbody>" << std::endl;
463 iIniFile << "\t<label>" << label << "</label>" << std::endl;
464 iIniFile << "</actionbody>" << std::endl;
465 iIniFile << "<actionresult>" << std::endl;
466 iIniFile << "\t<systemupgrade>" << aSystemUpgrade << "</systemupgrade>" << std::endl;
467 iIniFile << "</actionresult>" << std::endl;
468 iIniFile << std::endl;
472 void SWIStoreScriptGeneration::WriteRetrieveCerts(const char *label, const std::stringstream &aTestCaseType, int &aTestIndex)
474 const char *testcasename = "Retrieve Certificate";
475 const char *testcasetype = "retrieve";
476 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
477 iIniFile << "<actionbody>" << std::endl;
478 iIniFile << "\t<label>" << label << "</label>" << std::endl;
479 iIniFile << "</actionbody>" << std::endl;
480 iIniFile << std::endl;
485 void SWIStoreScriptGeneration::WriteGetApplications(const char *label, const std::stringstream &aTestCaseType, int &aTestIndex)
487 const char *testcasename = "Get applications";
488 const char *testcasetype = "getapplications";
489 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
490 iIniFile << "<actionbody>" << std::endl;
491 iIniFile << "\t<label>" << label << "</label>" << std::endl;
492 iIniFile << "</actionbody>" << std::endl;
493 iIniFile << "<actionresult>" << std::endl;
494 iIniFile << "\t<uid>";
495 for(int j = 0; j<2; j++)
497 iIniFile << emu_cacertsUid[j] << " ";
499 iIniFile << "</uid>" << std::endl;
500 iIniFile << "</actionresult>" << std::endl;
501 iIniFile << std::endl;
505 void SWIStoreScriptGeneration::WriteGetTrust(const char *label, const char *trust, const std::stringstream &aTestCaseType, int &aTestIndex)
507 const char *testcasename = "Get Trust certificate";
508 const char *testcasetype = "gettrusters";
509 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
510 iIniFile << "<actionbody>" << std::endl;
511 iIniFile << "\t<label>" << label << "</label>" << std::endl;
512 iIniFile << "</actionbody>" << std::endl;
513 iIniFile << "<actionresult>" << std::endl;
514 iIniFile << "\t<trust>" << trust << "</trust>" << std::endl;
515 iIniFile << "</actionresult>" << std::endl;
516 iIniFile << std::endl;
521 void SWIStoreScriptGeneration::WriteGetCapabilities(const char *label, const std::stringstream &aTestCaseType, int &aTestIndex)
523 const char *testcasename = "Get the capabilities";
524 const char *testcasetype = "getcapabilities";
525 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
526 iIniFile << "<actionbody>" << std::endl;
527 iIniFile << "\t<label>" << label << "</label>" << std::endl;
528 iIniFile << "</actionbody>" << std::endl;
529 iIniFile << "<actionresult>" << std::endl;
530 for(int i=0; i<20; i++)
532 iIniFile << "\t<capability>" << goodCapabilitySets[i] << "</capability>" << std::endl;
534 iIniFile << "</actionresult>" << std::endl;
535 iIniFile << std::endl;
539 void SWIStoreScriptGeneration::WriteGetMandatoryFlag(const char *label, const char *aMandatory, const std::stringstream &aTestCaseType, int &aTestIndex)
541 const char *testcasename = "Get the mandatory flag";
542 const char *testcasetype = "getmandatory";
543 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
544 iIniFile << "<actionbody>" << std::endl;
545 iIniFile << "\t<label>" << label << "</label>" << std::endl;
546 iIniFile << "</actionbody>" << std::endl;
547 iIniFile << "<actionresult>" << std::endl;
548 iIniFile << "\t<mandatory>" << aMandatory << "</mandatory>" << std::endl;
549 iIniFile << "</actionresult>" << std::endl;
550 iIniFile << std::endl;
554 //Cert client script generator
555 CertClientsStoreScriptGeneration::CertClientsStoreScriptGeneration(const std::stringstream &aFileName)
556 : ScriptAndIniGeneration(aFileName)
560 CertClientsStoreScriptGeneration::~CertClientsStoreScriptGeneration()
564 void CertClientsStoreScriptGeneration::WriteInitialiseCertClient(const std::stringstream &aTestCaseType, int &aTestIndex)
566 const char *testcasename = "Initialise a CertClientStore";
567 const char *testcasetype = "InitManager";
568 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype, false);
571 void CertClientsStoreScriptGeneration::WriteGetCount(const int aApp_uidIndex, const std::stringstream &aTestCaseType, int &aTestIndex)
573 const char *testcasename = "Get Count of Applications";
574 const char *testcasetype = "AppCount";
575 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
576 iIniFile << "<actionbody>" << std::endl;
577 iIniFile << "\t<count>" << aApp_uidIndex << "</count>" << std::endl;
578 iIniFile << "</actionbody>" << std::endl;
579 iIniFile << std::endl;
583 void CertClientsStoreScriptGeneration::WriteGetApplicationsList(const std::stringstream &aTestCaseType, int &aTestIndex)
585 const char *testcasename = "Getting the application list";
586 const char *testcasetype = "GetApplications";
587 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
588 iIniFile << "<actionbody>" << std::endl;
589 for(int i = 0 ; i<4 ; i++)
591 iIniFile << "\t<uid>" << gooddecimalUid_array[i] << "</uid>"<<"<appname>" << goodcertclient_array[i] << "</appname>" << std::endl;
593 iIniFile << "</actionbody>" << std::endl;
594 iIniFile << std::endl;
598 void CertClientsStoreScriptGeneration::WriteGetAppWithUid(const char *goodlabel,const char *uid,const std::stringstream &aTestCaseType,int &aTestIndex)
600 const char *testcasename = "Get application with given id";
601 const char *testcasetype = "GetApp";
602 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype);
603 iIniFile << "<actionbody>" << std::endl;
604 iIniFile << "\t<uid>" << uid << "</uid>" << std::endl;
605 iIniFile << "\t<appname>" << goodlabel << "</appname>" << std::endl;
606 iIniFile << "</actionbody>" << std::endl;
607 iIniFile << std::endl;
611 void CertClientsStoreScriptGeneration::WriteDestroyManager(const std::stringstream &aTestCaseType, int &aTestIndex)
613 const char *testcasename = "Destroy the manager";
614 const char *testcasetype = "DestroyManager";
615 WriteTestCaseToScript(aTestCaseType, ++aTestIndex, testcasename, testcasetype, false);
620 Class definition for creating cacerts
622 EmptyFileConfigWriter::EmptyFileConfigWriter(const std::stringstream &aFileName)
623 : GoodConfigWriter(aFileName)
625 iFile << "StartCertStoreEntries" << std::endl;
628 EmptyFileConfigWriter::~EmptyFileConfigWriter()
630 iFile << "EndCertStoreEntries" << std::endl;