sl@0: /* sl@0: * Copyright (c) 2002-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: * CFSCertAppsServer 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 __CFSCERTAPPSSERVER_H__ sl@0: #define __CFSCERTAPPSSERVER_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: class CFSCertAppsToken; sl@0: class CCertAppsSession; sl@0: class CCertAppsConduit; sl@0: sl@0: class CFSCertAppsServer : public CBase sl@0: { sl@0: public: sl@0: static CFSCertAppsServer* NewL(); sl@0: virtual ~CFSCertAppsServer(); sl@0: CCertAppsSession* CreateSessionL(); sl@0: sl@0: public: sl@0: void AddL(const TCertificateAppInfo& aClient); sl@0: void RemoveL(const TUid& aUid); sl@0: TInt ApplicationCountL() const; sl@0: void ApplicationsL(RArray& aAppArray) const; sl@0: void ApplicationL(const TUid& aUid, TCertificateAppInfo& aInfo) const; sl@0: sl@0: private: sl@0: CFSCertAppsServer(); sl@0: void ConstructL(); sl@0: sl@0: /// Finds an application and returns NULL if not found - if aIndex is not sl@0: /// null then index is copied there sl@0: const TCertificateAppInfo* FindApplication(const TUid& aUid, TInt* aIndex = NULL) const; sl@0: sl@0: /// Configures the object from the file store. Will create a new store sl@0: /// if one does not exist sl@0: void OpenStoreL(); sl@0: /// Opens a Composite store present under ROM drive. sl@0: void OpenCompositeStoreL(const TDesC& aFilename); sl@0: /// Attempt to load the cert apps from the given file sl@0: void ReadStoreContentsL(const TDesC& aFilename); sl@0: /// Create a new empty store sl@0: void CreateStoreL(const TDesC& aFilename); sl@0: /// aggregate the store files sl@0: void AggregateStoreFileL(const TDesC& aFile); sl@0: /// aggregate certificate client entries. sl@0: void MergeCertificateEntryListL(const RArray& aSourceList); sl@0: /// finds if an uid exists in the entry list sl@0: TBool FindUid(const TUid& aUid); sl@0: // TCleanup items used when creating a store or replacing a stream sl@0: static void DeleteStoreFile(TAny* aThis); sl@0: static void RevertStore(TAny* aStore); sl@0: sl@0: /// Replaces the store - called by both Add and Remove. sl@0: /// Leaves if failed. ExcludedIndex is the index into the sl@0: /// array to be excluded. -1 if none are excluded sl@0: void ReplaceAndCommitL(TInt aExcludedIndex = -1); sl@0: sl@0: /// Externalizes the array into a stream - commits it if successful sl@0: void WriteClientArrayL(RWriteStream& stream, TInt aExcludedIndex = -1) const; sl@0: sl@0: private: sl@0: /// The conduit object used for marshalling/unmarshalling client communications sl@0: CCertAppsConduit* iConduit; sl@0: RFs iFs; sl@0: /// The store where the client are stored sl@0: CPermanentFileStore* iStore; sl@0: TStreamId iId; sl@0: /// A cache of the contents of the store sl@0: RArray iClients; sl@0: /// Used to distinguish variant specific feature from the default. sl@0: TUint8 iPatchableConst; sl@0: }; sl@0: sl@0: #endif // __CFSCERTAPPSSERVER_H__