First public contribution.
2 * Copyright (c) 2005-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.
24 #ifndef __SWICERTSTORE_H__
25 #define __SWICERTSTORE_H__
27 #include <mctcertstore.h>
29 class CSWICertStoreImpl;
30 class CSWICertStoreToken;
32 /** Addtional meta-data information about the Certificate */
36 TCapabilitySet iCapabilities;
38 TBool iIsSystemUpgrade;
41 // The certificate is marked for mandatory flag
42 const TUint8 KMandatory = 0x00;
43 // The certificate is marked for System Upgrade flag
44 const TUint8 KSystemUpgrade = 0x01;
48 * SWI Cert store token type UID.
50 const TUint KSWICertStoreTokenTypeUid = 0x102042BA;
53 * The software install certificate store.
55 * To support platform security, software install uses an independant ROM-based
56 * certificate store to find root certs. In addition to the usual meta-data,
57 * this also associates a set of capabilities and a mandatory flag with each
60 * Although this class supports the MCTCertStore interface, the implementation
63 NONSHARABLE_CLASS(CSWICertStore) : protected CBase, public MCTCertStore
66 /// Create token type, for use by swicertstoreplugin
67 IMPORT_C static CCTTokenType* CreateTokenTypeL();
69 /// Create the cert store interface directly without going through ecom
70 IMPORT_C static CSWICertStore* NewL(RFs& aFs);
72 /// Create the cert store interface, called by token's GetInterface() method
73 static CSWICertStore* NewL(CSWICertStoreToken& aToken, RFs& aFs);
75 // Implementation of MCTTokenInterface
76 virtual MCTToken& Token();
78 // Implementation of MCTCertStore
79 virtual void List(RMPointerArray<CCTCertInfo>& aCerts,
80 const CCertAttributeFilter& aFilter, TRequestStatus& aStatus);
81 virtual void CancelList();
82 virtual void GetCert(CCTCertInfo*& aCertInfo, const TCTTokenObjectHandle& aHandle,
83 TRequestStatus& aStatus);
84 virtual void CancelGetCert();
85 virtual void Applications(const CCTCertInfo& aCertInfo, RArray<TUid>& aAplications,
86 TRequestStatus& aStatus);
87 virtual void CancelApplications();
88 virtual void IsApplicable(const CCTCertInfo& aCertInfo, TUid aApplication,
89 TBool& aIsApplicable, TRequestStatus& aStatus);
90 virtual void CancelIsApplicable();
91 virtual void Trusted(const CCTCertInfo& aCertInfo, TBool& aTrusted,
92 TRequestStatus& aStatus);
93 virtual void CancelTrusted();
94 virtual void Retrieve(const CCTCertInfo& aCertInfo, TDes8& aEncodedCert,
95 TRequestStatus& aStatus);
96 virtual void CancelRetrieve();
98 // Addtional meta-data accessors
99 IMPORT_C const TCertMetaInfo& CertMetaInfoL(const CCTCertInfo& aCertInfo);
102 // Implementation of MCTTokenInterface
103 virtual void DoRelease();
106 CSWICertStore(CSWICertStoreToken& aToken);
107 virtual ~CSWICertStore();
108 void ConstructL(RFs& aFs);
111 CSWICertStoreToken& iToken;
112 CSWICertStoreImpl* iImpl;