os/security/cryptoservices/filebasedcertificateandkeystores/source/certapps/server/CFSCertAppsServer.h
Update contrib.
2 * Copyright (c) 2002-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 * CFSCertAppsServer class implementation
25 #ifndef __CFSCERTAPPSSERVER_H__
26 #define __CFSCERTAPPSSERVER_H__
31 #include <mctcertapps.h>
33 class CFSCertAppsToken;
34 class CCertAppsSession;
35 class CCertAppsConduit;
37 class CFSCertAppsServer : public CBase
40 static CFSCertAppsServer* NewL();
41 virtual ~CFSCertAppsServer();
42 CCertAppsSession* CreateSessionL();
45 void AddL(const TCertificateAppInfo& aClient);
46 void RemoveL(const TUid& aUid);
47 TInt ApplicationCountL() const;
48 void ApplicationsL(RArray<TCertificateAppInfo>& aAppArray) const;
49 void ApplicationL(const TUid& aUid, TCertificateAppInfo& aInfo) const;
55 /// Finds an application and returns NULL if not found - if aIndex is not
56 /// null then index is copied there
57 const TCertificateAppInfo* FindApplication(const TUid& aUid, TInt* aIndex = NULL) const;
59 /// Configures the object from the file store. Will create a new store
60 /// if one does not exist
62 /// Opens a Composite store present under ROM drive.
63 void OpenCompositeStoreL(const TDesC& aFilename);
64 /// Attempt to load the cert apps from the given file
65 void ReadStoreContentsL(const TDesC& aFilename);
66 /// Create a new empty store
67 void CreateStoreL(const TDesC& aFilename);
68 /// aggregate the store files
69 void AggregateStoreFileL(const TDesC& aFile);
70 /// aggregate certificate client entries.
71 void MergeCertificateEntryListL(const RArray<TCertificateAppInfo>& aSourceList);
72 /// finds if an uid exists in the entry list
73 TBool FindUid(const TUid& aUid);
74 // TCleanup items used when creating a store or replacing a stream
75 static void DeleteStoreFile(TAny* aThis);
76 static void RevertStore(TAny* aStore);
78 /// Replaces the store - called by both Add and Remove.
79 /// Leaves if failed. ExcludedIndex is the index into the
80 /// array to be excluded. -1 if none are excluded
81 void ReplaceAndCommitL(TInt aExcludedIndex = -1);
83 /// Externalizes the array into a stream - commits it if successful
84 void WriteClientArrayL(RWriteStream& stream, TInt aExcludedIndex = -1) const;
87 /// The conduit object used for marshalling/unmarshalling client communications
88 CCertAppsConduit* iConduit;
90 /// The store where the client are stored
91 CPermanentFileStore* iStore;
93 /// A cache of the contents of the store
94 RArray<TCertificateAppInfo> iClients;
95 /// Used to distinguish variant specific feature from the default.
96 TUint8 iPatchableConst;
99 #endif // __CFSCERTAPPSSERVER_H__