os/security/cryptoservices/certificateandkeymgmt/tpkixcert_tef/src/tpkixcertserver.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 "tpkixcertserver.h"
20 #include "apiteststeps.h"
21 #include "validateteststep.h"
22 #include "datetimefatalteststep.h"
24 _LIT(KServerName,"tpkixcert_tefserver");
27 CPkixCertTestServer* CPkixCertTestServer::NewL()
29 CPkixCertTestServer* server = new (ELeave) CPkixCertTestServer();
30 CleanupStack::PushL(server);
31 server->ConstructL(KServerName);
32 CleanupStack::Pop(server);
37 CTestStep* CPkixCertTestServer::CreateTestStep(const TDesC& aStepName)
39 CTestStep* testStep = NULL;
41 if (aStepName == KAddSupportedOidsTestStep)
43 testStep = new CPkixCertAddSupportedOidsStep;
45 else if (aStepName == KRemoveSupportedOidsTestStep)
47 testStep = new CPkixCertRemoveSupportedOidsStep;
49 else if (aStepName == KSetSupportedOidsTestStep)
51 testStep = new CPkixCertSetSupportedOidsStep;
53 else if (aStepName == KResetSupportedOidsTestStep)
55 testStep = new CPkixCertResetSupportedOidsStep;
57 else if (aStepName == KValidateCertChainStep)
59 testStep = new CValidateCertChainStep;
61 else if (aStepName == KDateTimeFatalTestStep)
63 testStep = new CDateTimeFatalValidateStep;
73 // Leave the hooks in for platform security
74 #if (defined __DATA_CAGING__)
75 RProcess().DataCaging(RProcess::EDataCagingOn);
76 RProcess().SecureApi(RProcess::ESecureApiOn);
78 CActiveScheduler* sched=NULL;
79 sched=new(ELeave) CActiveScheduler;
80 CActiveScheduler::Install(sched);
81 CPkixCertTestServer* server = NULL;
82 TRAPD(err,server = CPkixCertTestServer::NewL());
85 // Sync with the client and enter the active scheduler
86 RProcess::Rendezvous(KErrNone);
94 GLDEF_C TInt E32Main()
97 CTrapCleanup* cleanup = CTrapCleanup::New();
102 TRAP_IGNORE(MainL());