os/security/cryptoservices/certificateandkeymgmt/swicertstore/CSWICertStoreImpl.h
First public contribution.
2 * Copyright (c) 2004-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 * CSWICertStoreImpl class implementation
25 #ifndef __CSWICERTSTOREIMPL_H__
26 #define __CSWICERTSTOREIMPL_H__
31 #include <ct/rmpointerarray.h>
32 #include <e32property.h>
36 class CSWICertStoreEntryList;
37 class CCertAttributeFilter;
38 class TCTTokenObjectHandle;
39 class CSWICertStoreEntry;
43 * This class implements the guts of the SWI cert store. It is mainly a cut
44 * down version of the filetokens cert store server.
46 NONSHARABLE_CLASS(CSWICertStoreImpl) : public CActive
49 static CSWICertStoreImpl* NewL(MCTToken& aToken, RFs& aFs);
50 virtual ~CSWICertStoreImpl();
54 void ListL(RMPointerArray<CCTCertInfo>& aCerts,
55 const CCertAttributeFilter& aFilter);
56 CCTCertInfo* GetCertL(const TCTTokenObjectHandle& aHandle);
57 void ApplicationsL(const TCTTokenObjectHandle& aHandle, RArray<TUid>& aAplications);
58 TBool IsApplicableL(const TCTTokenObjectHandle& aHandle, TUid aApplication);
59 TBool TrustedL(const TCTTokenObjectHandle& aHandle);
60 void RetrieveL(const TCTTokenObjectHandle& aHandle, TDes8& aEncodedCert);
62 // Addtional meta-data accessors
63 const TCertMetaInfo& CertMetaInfoL(const TCTTokenObjectHandle& aHandle) const;
66 CSWICertStoreImpl(MCTToken& aToken, RFs& aFs);
69 // Open the Writable certstore and setup the iCEntryList
70 void SetupWritableCertStoreL();
72 // Open the ROM certstore and setup the iZEntryList
73 void SetupROMCertStoreL();
74 void SetupCompositeROMCertStoreL();
75 static void FilterCertificateListL(RMPointerArray<CCTCertInfo>& aCerts,
76 const CCertAttributeFilter& aFilter, const CSWICertStoreEntryList& aEntryList);
77 static void AddIfMatchesFilterL(RMPointerArray<CCTCertInfo>& aCerts,
78 const CCertAttributeFilter& aFilter, const CSWICertStoreEntry& aEntry);
79 const CSWICertStoreEntry* GetCSWICertStoreEntryL(const TCTTokenObjectHandle& aHandle, TBool& aCEntryHandle) const;
80 void MergeCertificateEntryListsL(const CSWICertStoreEntryList& aSourceList, TBool aIsZEntryList = EFalse );
82 protected: // From CActive
90 /// File server session
93 /// Persistent store containg the certs
94 CPermanentFileStore* iCStore;
95 CPermanentFileStore* iZStore;
97 /// The list of certificates contained in the store.
98 CSWICertStoreEntryList* iCEntryList;
99 CSWICertStoreEntryList* iZEntryList;
102 RProperty iSwicertstoreProperty;
103 RPointerArray<CPermanentFileStore> iZArrayOfStores;
104 /// Used to distinguish variant specific feature from the default.
105 TUint8 iPatchableConst;