First public contribution.
2 * Copyright (c) 2007-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.
15 * tpkcs10minortests.cpp
20 #include "tpkcs10serverv2.h"
21 #include "tcertrequeststep.h"
22 #include "tpkcs10negatives.h"
23 #include "tpkcs10minortests.h"
25 _LIT(KServerName,"tpkcs10serverv2");
26 CTPKCS10Server* CTPKCS10Server::NewL()
28 * @return - Instance of the test server
29 * Same code for Secure and non-secure variants
30 * Called inside the MainL() function to create and start the
31 * CTestServer derived server.
34 CTPKCS10Server * server = new (ELeave) CTPKCS10Server();
35 CleanupStack::PushL(server);
37 server->ConstructL(KServerName);
38 CleanupStack::Pop(server);
43 // Secure variants much simpler
44 // For EKA2, just an E32Main and a MainL()
48 * Much simpler, uses the new Rendezvous() call to sync with the client
51 // Leave the hooks in for platform security
52 #if (defined __DATA_CAGING__)
53 RProcess().DataCaging(RProcess::EDataCagingOn);
54 RProcess().DataCaging(RProcess::ESecureApiOn);
56 CActiveScheduler* sched=NULL;
57 sched=new(ELeave) CActiveScheduler;
58 CActiveScheduler::Install(sched);
59 CTPKCS10Server* server = NULL;
60 // Create the CTestServer derived server
61 TRAPD(err,server = CTPKCS10Server::NewL());
64 // Sync with the client and enter the active scheduler
65 RProcess::Rendezvous(KErrNone);
74 GLDEF_C TInt E32Main()
76 * @return - Standard Epoc error code on process exit
78 * Process entry point. Called by client using RProcess API
82 CTrapCleanup* cleanup = CTrapCleanup::New();
94 CTestStep* CTPKCS10Server::CreateTestStep(const TDesC& aStepName)
96 * @return - A CTestStep derived instance
97 * Secure and non-secure variants
98 * Implementation of CTestServer pure virtual
101 CTestStep* testStep = NULL;
102 if(aStepName == KCertificateRequestStep)
104 testStep = new CCertificateRequestStep();
107 else if(aStepName == KPKCS10ReuseAttributeStep)
109 testStep = new CPKCS10ReuseAttributeStep();
112 else if(aStepName == KPKCS10ReuseChallengePasswordAttr)
114 testStep = new CPKCS10ReuseChallengePasswordAttrStep();
117 else if(aStepName == KPKCS10ReuseExtensionAttr)
119 testStep = new CPKCS10ReuseExtensionAttrStep();
122 else if(aStepName == KPKCS10NegPKCS10GenericAttr)
124 testStep = new CPKCS10NegPKCS10GenericAttr();
127 else if (aStepName == KPKCS10NegPKCS9ChallengePasswordAttr)
129 testStep = new CPKCS10NegPKCS9ChallengePasswordAttr();
132 else if (aStepName == KPKCS10NegPKCS9ExtensionRequestAttr)
134 testStep = new CPKCS10NegPKCS9ExtensionRequestAttr();
137 else if (aStepName == KPKCS10NegPKCS10Attributes)
139 testStep = new CPKCS10NegPKCS10Attributes();
142 else if (aStepName == KPKCS10NegPKCS10Request)
144 testStep = new CPKCS10NegPKCS10Request();
147 else if (aStepName == KPKCS10CancelRequestA)
149 testStep = new CPKCS10CancelRequestAStep();