os/security/cryptoservices/certificateandkeymgmt/tcertstore/t_testcertfordeletable.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 * CTestCertForDeletable class implementation
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file 
    22  @internalTechnology
    23 */
    24  
    25 #ifndef __T_TESTCERTFORDELETABLE_H__
    26 #define __T_TESTCERTFORDELETABLE_H__
    27 
    28 #include "t_certstoreactions.h"
    29 #include "t_testactionspec.h"
    30 #include <mctkeystore.h>
    31 #include <unifiedkeystore.h>
    32 
    33 /** 
    34  * This class tests the addition of a certificate to the store.
    35  */
    36 class CTestCertForDeletable : public CCertStoreTestAction
    37 	{
    38 public:
    39 	static CTestAction* NewL(	RFs& aFs, 
    40 								CConsoleBase& aConsole, 
    41 								Output& aOut, 
    42 								const TTestActionSpec& aTestActionSpec);
    43 	~CTestCertForDeletable();
    44 	virtual void PerformAction(TRequestStatus& aStatus);
    45 	virtual void PerformCancel();
    46 	virtual void AfterOOMFailure();
    47 	virtual void Reset();
    48 
    49 private:
    50 	CTestCertForDeletable(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
    51 	void ConstructL(const TTestActionSpec& aTestActionSpec);
    52 	void DoReportAction();
    53 	void DoCheckResult(TInt aError);
    54 
    55 	void WriteFormat(TCertificateFormat aFormat);
    56 	void WriteOwnerType();
    57 	void SetKeyId(TKeyIdentifier& aKeyIdentifier, const TDesC8& aKeyInfo);
    58 	void SetCertFormatL(const TDesC8& aFormat);
    59 	void SetCertOwnerTypeL(const TDesC8& aOwnerType);
    60 	void SetCertLabelL(const TDesC8& aLabel);
    61 	void SetStoreToUse(const TDesC8& aStoreToUse);
    62 	void SetDeletable(const TDesC8& aStringValue);
    63 	void SetSubActionL(const TDesC8& aStringValue);
    64 	void SetCertificateContentL(const TDesC8& aFileName);
    65 	void ConstructCertL(const TDesC8& aCert);
    66 
    67 	void TestSerializationL(MCTToken& aToken,
    68 							TKeyIdentifier* aIssuerKeyId,
    69 							TKeyIdentifier* aSubjectKeyId, 
    70 							const TInt aCertificateId,
    71 							const TDesC8* aIssuerHash );
    72 private:
    73 	enum TState
    74 		{
    75 		ETestSerialization,
    76 		ETestNewCSClasswDeletable,
    77 		ETestOldCSClasswoDeletable,
    78 		EFinished
    79 		};
    80 
    81 private:
    82 	TState iState;
    83 	CCertificate* iCertificate;
    84 	HBufC8* iCertificateURL;
    85 	HBufC* iCertificateLabel;
    86 	TCertificateFormat iCertificateFormat;
    87 	TCertificateOwnerType iOwnerType;
    88 	TKeyIdentifier iIssuerKeyId;
    89 	TKeyIdentifier iSubjectKeyId;
    90 	TInt iStoreIndex;
    91 	TBool iSelfInit;
    92 	TBool iResultGood;
    93 
    94 	HBufC8* iCertificateContent;
    95 
    96 	CCTCertInfo* iCertInfo;
    97 	CCertificate* iCert;
    98 	TBool iDeletable;
    99 	};
   100 	
   101 	
   102 #endif