os/security/cryptoservices/certificateandkeymgmt/tcertstore/t_swicertstoreactions.h
First public contribution.
2 * Copyright (c) 2004-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 * Actions for testing additional metadata supplied by the SWI cert store, ie
16 * capabilties, mandatory and systemupgrade flag: - get capabilities - get mandatory - get systemupgrade flag
26 #ifndef __T_METADATAACTIONS_H__
27 #define __T_METADATAACTIONS_H__
29 #include "t_certstoreactions.h"
34 * Test action to initialise an instance of the SWI cert store.
36 * Delete is handled by the standard delete action.
38 class CInitSWICertStoreAction : public CCertStoreTestAction
41 static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
42 const TTestActionSpec& aTestActionSpec);
45 // Implement test action methods
46 virtual void PerformAction(TRequestStatus& aStatus);
47 virtual void PerformCancel();
51 CInitSWICertStoreAction(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
52 void ConstructL(const TTestActionSpec& aTestActionSpec);
54 virtual void DoReportAction();
55 virtual void DoCheckResult(TInt aError);
70 * Base class for SWI cert store meta data test actions.
72 class CSWICertStoreTestAction : public CCertStoreTestAction
75 virtual ~CSWICertStoreTestAction();
77 // Implement test action methods
78 virtual void PerformAction(TRequestStatus& aStatus);
79 virtual void PerformCancel();
83 CSWICertStoreTestAction(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
84 void ConstructL(const TTestActionSpec& aTestActionSpec);
86 // Define interface for derived classes
87 virtual void DoConstructL(const TTestActionSpec& aTestActionSpec) = 0;
88 virtual void DoPerformActionL(CCTCertInfo& aCertInfo) = 0;
89 virtual void DoCancel() = 0;
100 CCTCertInfo* FindCertificate();
104 TCertLabel iCertificateLabel; ///< The certificate we're acting on
105 RMPointerArray<CCTCertInfo> iCertInfos; ///< List of all certificates found
106 CCertAttributeFilter* iFilter; ///< Filter to use when listing certs
110 * Test action to get the capabilties associated with a certificate.
112 class CGetCapabilitiesAction : public CSWICertStoreTestAction
115 static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
116 const TTestActionSpec& aTestActionSpec);
119 CGetCapabilitiesAction(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
120 virtual void DoConstructL(const TTestActionSpec& aTestActionSpec);
121 virtual void DoReportAction();
122 virtual void DoPerformActionL(CCTCertInfo& aCertInfo);
123 virtual void DoCheckResult(TInt aError);
124 virtual void DoCancel();
127 TCapabilitySet iExpectedCapapbilities;
128 TCapabilitySet iCapabilities;
132 * Test action to get the mandatory flag associated with a certificate.
134 class CGetMandatoryAction : public CSWICertStoreTestAction
137 static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
138 const TTestActionSpec& aTestActionSpec);
141 CGetMandatoryAction(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
142 virtual void DoConstructL(const TTestActionSpec& aTestActionSpec);
143 virtual void DoReportAction();
144 virtual void DoPerformActionL(CCTCertInfo& aCertInfo);
145 virtual void DoCheckResult(TInt aError);
146 virtual void DoCancel();
149 TBool iExpectedValue;
154 * Test action to get the systemupgrade flag associated with a certificate.
156 class CGetSystemUpgradeAction : public CSWICertStoreTestAction
159 static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
160 const TTestActionSpec& aTestActionSpec);
163 CGetSystemUpgradeAction(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
164 virtual void DoConstructL(const TTestActionSpec& aTestActionSpec);
165 virtual void DoReportAction();
166 virtual void DoPerformActionL(CCTCertInfo& aCertInfo);
167 virtual void DoCheckResult(TInt aError);
168 virtual void DoCancel();
171 TBool iExpectedSystemUpgradeValue;
172 TBool iSystemUpgradeValue;
176 * Test action to get the deletable flag associated with a certificate.
179 class CGetDeletionAction : public CSWICertStoreTestAction
182 static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
183 const TTestActionSpec& aTestActionSpec);
186 CGetDeletionAction(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
187 virtual void DoConstructL(const TTestActionSpec& aTestActionSpec);
188 virtual void DoReportAction();
189 virtual void DoPerformActionL(CCTCertInfo& aCertInfo);
190 virtual void DoCheckResult(TInt aError);
191 virtual void DoCancel();
194 TBool iExpectedDeletableValue;
195 TBool iDeletableValue;
199 * Test action to verify multiple readers
202 class CMultipleReadersAction : public CSWICertStoreTestAction
205 static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
206 const TTestActionSpec&
210 CMultipleReadersAction(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
211 virtual void DoConstructL(const TTestActionSpec& aTestActionSpec);
212 virtual void DoReportAction();
213 virtual void DoPerformActionL(CCTCertInfo& aCertInfo);
214 virtual void DoCheckResult(TInt aError);
215 virtual void DoCancel();
218 TBool iExpectedValue;