os/security/cryptoservices/certificateandkeymgmt/tcertstore/t_testcertfordeletable.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptoservices/certificateandkeymgmt/tcertstore/t_testcertfordeletable.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,102 @@
     1.4 +/*
     1.5 +* Copyright (c) 2004-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 +* CTestCertForDeletable class implementation
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +/**
    1.24 + @file 
    1.25 + @internalTechnology
    1.26 +*/
    1.27 + 
    1.28 +#ifndef __T_TESTCERTFORDELETABLE_H__
    1.29 +#define __T_TESTCERTFORDELETABLE_H__
    1.30 +
    1.31 +#include "t_certstoreactions.h"
    1.32 +#include "t_testactionspec.h"
    1.33 +#include <mctkeystore.h>
    1.34 +#include <unifiedkeystore.h>
    1.35 +
    1.36 +/** 
    1.37 + * This class tests the addition of a certificate to the store.
    1.38 + */
    1.39 +class CTestCertForDeletable : public CCertStoreTestAction
    1.40 +	{
    1.41 +public:
    1.42 +	static CTestAction* NewL(	RFs& aFs, 
    1.43 +								CConsoleBase& aConsole, 
    1.44 +								Output& aOut, 
    1.45 +								const TTestActionSpec& aTestActionSpec);
    1.46 +	~CTestCertForDeletable();
    1.47 +	virtual void PerformAction(TRequestStatus& aStatus);
    1.48 +	virtual void PerformCancel();
    1.49 +	virtual void AfterOOMFailure();
    1.50 +	virtual void Reset();
    1.51 +
    1.52 +private:
    1.53 +	CTestCertForDeletable(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
    1.54 +	void ConstructL(const TTestActionSpec& aTestActionSpec);
    1.55 +	void DoReportAction();
    1.56 +	void DoCheckResult(TInt aError);
    1.57 +
    1.58 +	void WriteFormat(TCertificateFormat aFormat);
    1.59 +	void WriteOwnerType();
    1.60 +	void SetKeyId(TKeyIdentifier& aKeyIdentifier, const TDesC8& aKeyInfo);
    1.61 +	void SetCertFormatL(const TDesC8& aFormat);
    1.62 +	void SetCertOwnerTypeL(const TDesC8& aOwnerType);
    1.63 +	void SetCertLabelL(const TDesC8& aLabel);
    1.64 +	void SetStoreToUse(const TDesC8& aStoreToUse);
    1.65 +	void SetDeletable(const TDesC8& aStringValue);
    1.66 +	void SetSubActionL(const TDesC8& aStringValue);
    1.67 +	void SetCertificateContentL(const TDesC8& aFileName);
    1.68 +	void ConstructCertL(const TDesC8& aCert);
    1.69 +
    1.70 +	void TestSerializationL(MCTToken& aToken,
    1.71 +							TKeyIdentifier* aIssuerKeyId,
    1.72 +							TKeyIdentifier* aSubjectKeyId, 
    1.73 +							const TInt aCertificateId,
    1.74 +							const TDesC8* aIssuerHash );
    1.75 +private:
    1.76 +	enum TState
    1.77 +		{
    1.78 +		ETestSerialization,
    1.79 +		ETestNewCSClasswDeletable,
    1.80 +		ETestOldCSClasswoDeletable,
    1.81 +		EFinished
    1.82 +		};
    1.83 +
    1.84 +private:
    1.85 +	TState iState;
    1.86 +	CCertificate* iCertificate;
    1.87 +	HBufC8* iCertificateURL;
    1.88 +	HBufC* iCertificateLabel;
    1.89 +	TCertificateFormat iCertificateFormat;
    1.90 +	TCertificateOwnerType iOwnerType;
    1.91 +	TKeyIdentifier iIssuerKeyId;
    1.92 +	TKeyIdentifier iSubjectKeyId;
    1.93 +	TInt iStoreIndex;
    1.94 +	TBool iSelfInit;
    1.95 +	TBool iResultGood;
    1.96 +
    1.97 +	HBufC8* iCertificateContent;
    1.98 +
    1.99 +	CCTCertInfo* iCertInfo;
   1.100 +	CCertificate* iCert;
   1.101 +	TBool iDeletable;
   1.102 +	};
   1.103 +	
   1.104 +	
   1.105 +#endif