os/security/cryptoservices/certificateandkeymgmt/tcertstore/t_unifiedcertstoreadd.h
First public contribution.
2 * Copyright (c) 1998-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 * CAddCertificate and CImportKey class implementations
25 #ifndef __T_UNIFIEDCERTSTOREADD_H__
26 #define __T_UNIFIEDCERTSTOREADD_H__
28 #include "t_certstoreactions.h"
29 #include "t_testactionspec.h"
30 #include <mctkeystore.h>
31 #include <unifiedkeystore.h>
34 * This class tests the addition of a certificate to the store.
36 class CAddCertificate : public CSubscriberAction
39 static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut,
40 const TTestActionSpec& aTestActionSpec);
42 virtual void PerformAction(TRequestStatus& aStatus);
43 virtual void PerformCancel();
44 virtual void AfterOOMFailure();
48 CAddCertificate(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
49 void ConstructL(const TTestActionSpec& aTestActionSpec);
50 void DoReportAction();
51 void DoCheckResult(TInt aError);
53 void WriteOwnerType();
54 void SetKeyId(TKeyIdentifier& aKeyIdentifier, const TDesC8& aKeyInfo);
55 void SetDeletable(const TDesC8& aDeletable);
56 void SetCertFormatL(const TDesC8& aFormat);
57 void SetCertOwnerTypeL(const TDesC8& aOwnerType);
58 void SetCertLabelL(const TDesC8& aLabel);
59 void SetStoreToUse(const TDesC8& aStoreToUse);
60 void SetCertificateContentL(const TDesC8& aFileName);
61 void ConstructCertL(const TDesC8& aCert);
73 CCertificate* iCertificate;
74 HBufC8* iCertificateURL;
75 HBufC* iCertificateLabel;
76 TCertificateFormat iCertificateFormat;
77 TCertificateOwnerType iOwnerType;
78 TKeyIdentifier iIssuerKeyId;
79 TKeyIdentifier iSubjectKeyId;
81 TBool iDeletableFlagPresent;
85 * This is the data of the certificate, it is the data that will be written to
86 * the store for any kind of certificates (URL, X.509, WTLS...)
88 HBufC8* iCertificateContent;
92 class CImportKey : public CCertStoreTestAction
95 static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, Output& aOut, const TTestActionSpec& aTestActionSpec);
96 static CTestAction* NewLC(RFs& aFs, CConsoleBase& aConsole, Output& aOut, const TTestActionSpec& aTestActionSpec);
98 virtual void PerformAction(TRequestStatus& aStatus);
99 virtual void PerformCancel();
100 virtual void Reset();
102 TBool SetKeyUsage(const TDesC8& aKeyUsage);
103 void SetKeyLabel(const TDesC8& aKeyLabel);
104 TBool SetKeyAccessType(const TDesC8& aKeyAccessType);
105 void SetKeyDataFileL(const TDesC8& aDes);
106 void SetKeyPassphrase(const TDesC8& aDes);
108 CImportKey(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
109 void ConstructL(const TTestActionSpec& aTestActionSpec);
111 void DoReportAction();
112 void DoCheckResult(TInt aError);
123 TKeyUsagePKCS15 iUsage;
128 CUnifiedKeyStore* iUnifiedKeyStore;
129 CCTKeyInfo* iKeyInfo;