os/security/cryptoservices/certificateandkeymgmt/tcertstore/t_unifiedcertstoreremove.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/cryptoservices/certificateandkeymgmt/tcertstore/t_unifiedcertstoreremove.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,143 @@
1.4 +/*
1.5 +* Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +/**
1.23 + @file
1.24 + @internalTechnology
1.25 +*/
1.26 +
1.27 +#ifndef __T_UNIFIEDCERTSTOREREMOVE_H__
1.28 +#define __T_UNIFIEDCERTSTOREREMOVE_H__
1.29 +
1.30 +#include "t_certstoreactions.h"
1.31 +class CDeleteCertificate : public CSubscriberAction
1.32 + {
1.33 +
1.34 +public:
1.35 + static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
1.36 + const TTestActionSpec& aTestActionSpec);
1.37 + ~CDeleteCertificate();
1.38 +
1.39 +public:
1.40 + virtual void PerformAction(TRequestStatus& aStatus);
1.41 + virtual void PerformCancel();
1.42 + virtual void Reset();
1.43 +
1.44 +protected:
1.45 + CDeleteCertificate(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
1.46 + void GetCerts(TRequestStatus& aStatus);
1.47 + void DeleteCert(TRequestStatus& aStatus);
1.48 + void ConstructL(const TTestActionSpec& aTestActionSpec);
1.49 + void DoReportAction();
1.50 + void DoCheckResult(TInt aError);
1.51 + TBool CheckCertType( CCTCertInfo& aCertInfo);
1.52 +
1.53 +protected:
1.54 + enum TDeleteCertState
1.55 + {
1.56 + EIdle,
1.57 + EGettingCerts,
1.58 + EDeletingCert,
1.59 + ECheckNotification,
1.60 + EFinished
1.61 + };
1.62 +
1.63 +protected:
1.64 + TDeleteCertState iState;
1.65 + TCertLabel iCertLabel;
1.66 + RMPointerArray<CCTCertInfo> iCertInfos;
1.67 + CCTCertInfo* iCertInfoToDelete;
1.68 + CCertAttributeFilter* iFilter;
1.69 + TBool iDeleteAllCerts;
1.70 + HBufC8* iCertDeleteType;
1.71 + };
1.72 +
1.73 +class CDeleteRetrieveCertificate : public CSubscriberAction
1.74 + {
1.75 +public:
1.76 + virtual void PerformAction(TRequestStatus& aStatus);
1.77 + virtual void PerformCancel();
1.78 + virtual void Reset();
1.79 +
1.80 +protected:
1.81 + CDeleteRetrieveCertificate(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
1.82 + virtual void GetCerts(TRequestStatus& aStatus) = 0;
1.83 + virtual void RetrieveCerts(TRequestStatus& aStatus) = 0;
1.84 + virtual void DeleteCert(TRequestStatus& aStatus) = 0;
1.85 +
1.86 +protected:
1.87 + enum TDeleteCertState
1.88 + {
1.89 + EIdle,
1.90 + EGettingCerts,
1.91 + EDeletingCert,
1.92 + ECheckNotification,
1.93 + EFinished
1.94 + };
1.95 +
1.96 +protected:
1.97 + TDeleteCertState iState;
1.98 + TCertLabel iCertLabel;
1.99 + RPointerArray<HBufC8>* iCertlisted;
1.100 + RMPointerArray<CCTCertInfo> iCertInfos;
1.101 + CCTCertInfo* iCertInfoToDelete;
1.102 + CCTCertInfo* iCertInfoToRetrieve;
1.103 + TPtr8* iBuf;
1.104 + };
1.105 +
1.106 +class CDeleteRetrieveCACertificate : public CDeleteRetrieveCertificate
1.107 + {
1.108 +public:
1.109 + static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
1.110 + const TTestActionSpec& aTestActionSpec);
1.111 + ~CDeleteRetrieveCACertificate();
1.112 +
1.113 +private:
1.114 + CDeleteRetrieveCACertificate(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
1.115 + void ConstructL(const TTestActionSpec& aTestActionSpec);
1.116 + void GetCerts(TRequestStatus& aStatus);
1.117 + void RetrieveCerts(TRequestStatus& aStatus);
1.118 + void DeleteCert(TRequestStatus& aStatus);
1.119 + void DoReportAction();
1.120 + void DoCheckResult(TInt aError);
1.121 +
1.122 +private:
1.123 + CCertAttributeFilter* iFilter;
1.124 + };
1.125 +
1.126 +class CDeleteRetrieveUserCertificate : public CDeleteRetrieveCertificate
1.127 + {
1.128 +public:
1.129 + static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
1.130 + const TTestActionSpec& aTestActionSpec);
1.131 + ~CDeleteRetrieveUserCertificate();
1.132 +private:
1.133 + CDeleteRetrieveUserCertificate(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
1.134 + void ConstructL(const TTestActionSpec& aTestActionSpec);
1.135 + void GetCerts(TRequestStatus& aStatus);
1.136 + void RetrieveCerts(TRequestStatus& aStatus);
1.137 + void DeleteCert(TRequestStatus& aStatus);
1.138 + void DoReportAction();
1.139 + void DoCheckResult(TInt aError);
1.140 +
1.141 +private:
1.142 + CCertAttributeFilter* iFilter;
1.143 + };
1.144 +
1.145 +#endif
1.146 +