sl@0: /* sl@0: * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * CSWICertStoreImpl class implementation sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef __CSWICERTSTOREIMPL_H__ sl@0: #define __CSWICERTSTOREIMPL_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: class MCTToken; sl@0: class CCTCertInfo; sl@0: class CSWICertStoreEntryList; sl@0: class CCertAttributeFilter; sl@0: class TCTTokenObjectHandle; sl@0: class CSWICertStoreEntry; sl@0: class TCertMetaInfo; sl@0: sl@0: /** sl@0: * This class implements the guts of the SWI cert store. It is mainly a cut sl@0: * down version of the filetokens cert store server. sl@0: */ sl@0: NONSHARABLE_CLASS(CSWICertStoreImpl) : public CActive sl@0: { sl@0: public: sl@0: static CSWICertStoreImpl* NewL(MCTToken& aToken, RFs& aFs); sl@0: virtual ~CSWICertStoreImpl(); sl@0: sl@0: public: sl@0: // For MCTCertStore sl@0: void ListL(RMPointerArray& aCerts, sl@0: const CCertAttributeFilter& aFilter); sl@0: CCTCertInfo* GetCertL(const TCTTokenObjectHandle& aHandle); sl@0: void ApplicationsL(const TCTTokenObjectHandle& aHandle, RArray& aAplications); sl@0: TBool IsApplicableL(const TCTTokenObjectHandle& aHandle, TUid aApplication); sl@0: TBool TrustedL(const TCTTokenObjectHandle& aHandle); sl@0: void RetrieveL(const TCTTokenObjectHandle& aHandle, TDes8& aEncodedCert); sl@0: sl@0: // Addtional meta-data accessors sl@0: const TCertMetaInfo& CertMetaInfoL(const TCTTokenObjectHandle& aHandle) const; sl@0: sl@0: private: sl@0: CSWICertStoreImpl(MCTToken& aToken, RFs& aFs); sl@0: void ConstructL(); sl@0: sl@0: // Open the Writable certstore and setup the iCEntryList sl@0: void SetupWritableCertStoreL(); sl@0: sl@0: // Open the ROM certstore and setup the iZEntryList sl@0: void SetupROMCertStoreL(); sl@0: void SetupCompositeROMCertStoreL(); sl@0: static void FilterCertificateListL(RMPointerArray& aCerts, sl@0: const CCertAttributeFilter& aFilter, const CSWICertStoreEntryList& aEntryList); sl@0: static void AddIfMatchesFilterL(RMPointerArray& aCerts, sl@0: const CCertAttributeFilter& aFilter, const CSWICertStoreEntry& aEntry); sl@0: const CSWICertStoreEntry* GetCSWICertStoreEntryL(const TCTTokenObjectHandle& aHandle, TBool& aCEntryHandle) const; sl@0: void MergeCertificateEntryListsL(const CSWICertStoreEntryList& aSourceList, TBool aIsZEntryList = EFalse ); sl@0: sl@0: protected: // From CActive sl@0: void DoCancel(); sl@0: void RunL(); sl@0: sl@0: private: sl@0: /// Cert store token sl@0: MCTToken& iToken; sl@0: sl@0: /// File server session sl@0: RFs& iFs; sl@0: sl@0: /// Persistent store containg the certs sl@0: CPermanentFileStore* iCStore; sl@0: CPermanentFileStore* iZStore; sl@0: sl@0: /// The list of certificates contained in the store. sl@0: CSWICertStoreEntryList* iCEntryList; sl@0: CSWICertStoreEntryList* iZEntryList; sl@0: sl@0: TInt iCertIndex; sl@0: RProperty iSwicertstoreProperty; sl@0: RPointerArray iZArrayOfStores; sl@0: /// Used to distinguish variant specific feature from the default. sl@0: TUint8 iPatchableConst; sl@0: }; sl@0: sl@0: #endif