os/security/cryptoservices/certificateandkeymgmt/swicertstore/CSWICertStoreImpl.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptoservices/certificateandkeymgmt/swicertstore/CSWICertStoreImpl.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,108 @@
     1.4 +/*
     1.5 +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* CSWICertStoreImpl class implementation
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +/**
    1.24 + @file 
    1.25 + @internalTechnology
    1.26 +*/
    1.27 + 
    1.28 +#ifndef __CSWICERTSTOREIMPL_H__
    1.29 +#define __CSWICERTSTOREIMPL_H__
    1.30 +
    1.31 +#include <e32std.h>
    1.32 +#include <e32base.h>
    1.33 +#include <s32file.h>
    1.34 +#include <ct/rmpointerarray.h>
    1.35 +#include <e32property.h>
    1.36 +
    1.37 +class MCTToken;
    1.38 +class CCTCertInfo;
    1.39 +class CSWICertStoreEntryList;
    1.40 +class CCertAttributeFilter;
    1.41 +class TCTTokenObjectHandle;
    1.42 +class CSWICertStoreEntry;
    1.43 +class TCertMetaInfo;
    1.44 +
    1.45 +/**
    1.46 + * This class implements the guts of the SWI cert store.  It is mainly a cut
    1.47 + * down version of the filetokens cert store server.
    1.48 + */
    1.49 +NONSHARABLE_CLASS(CSWICertStoreImpl) : public CActive
    1.50 +	{
    1.51 +public:
    1.52 +	static CSWICertStoreImpl* NewL(MCTToken& aToken, RFs& aFs);
    1.53 +	virtual ~CSWICertStoreImpl();
    1.54 +
    1.55 +public:
    1.56 +	// For MCTCertStore
    1.57 +	void ListL(RMPointerArray<CCTCertInfo>& aCerts,
    1.58 +			   const CCertAttributeFilter& aFilter);
    1.59 +	CCTCertInfo* GetCertL(const TCTTokenObjectHandle& aHandle);		
    1.60 +	void ApplicationsL(const TCTTokenObjectHandle& aHandle, RArray<TUid>& aAplications);
    1.61 +	TBool IsApplicableL(const TCTTokenObjectHandle& aHandle, TUid aApplication);
    1.62 +	TBool TrustedL(const TCTTokenObjectHandle& aHandle);
    1.63 +	void RetrieveL(const TCTTokenObjectHandle& aHandle, TDes8& aEncodedCert);
    1.64 +
    1.65 +	// Addtional meta-data accessors
    1.66 +	const TCertMetaInfo& CertMetaInfoL(const TCTTokenObjectHandle& aHandle) const;	
    1.67 +	
    1.68 +private:
    1.69 +	CSWICertStoreImpl(MCTToken& aToken, RFs& aFs);
    1.70 +	void ConstructL();
    1.71 +
    1.72 +	// Open the Writable certstore and setup the iCEntryList
    1.73 +	void SetupWritableCertStoreL();
    1.74 +
    1.75 +	// Open the ROM certstore and setup the iZEntryList
    1.76 +	void SetupROMCertStoreL();
    1.77 +	void SetupCompositeROMCertStoreL();
    1.78 +	static void FilterCertificateListL(RMPointerArray<CCTCertInfo>& aCerts,
    1.79 +			   const CCertAttributeFilter& aFilter, const CSWICertStoreEntryList& aEntryList);
    1.80 +	static void AddIfMatchesFilterL(RMPointerArray<CCTCertInfo>& aCerts,
    1.81 +			   const CCertAttributeFilter& aFilter, const CSWICertStoreEntry& aEntry);
    1.82 +	const CSWICertStoreEntry* GetCSWICertStoreEntryL(const TCTTokenObjectHandle& aHandle, TBool& aCEntryHandle) const;
    1.83 +	void MergeCertificateEntryListsL(const CSWICertStoreEntryList& aSourceList, TBool aIsZEntryList = EFalse );
    1.84 +	
    1.85 +protected:	//	From CActive
    1.86 +	void DoCancel();
    1.87 +	void RunL();
    1.88 +
    1.89 +private:
    1.90 +	/// Cert store token
    1.91 +	MCTToken& iToken;
    1.92 +	
    1.93 +	/// File server session
    1.94 +	RFs& iFs;
    1.95 +	
    1.96 +	/// Persistent store containg the certs
    1.97 +	CPermanentFileStore* iCStore;
    1.98 +	CPermanentFileStore* iZStore;
    1.99 +
   1.100 +	/// The list of certificates contained in the store.
   1.101 +	CSWICertStoreEntryList* iCEntryList;
   1.102 +	CSWICertStoreEntryList* iZEntryList;
   1.103 +	
   1.104 +	TInt iCertIndex;
   1.105 +	RProperty iSwicertstoreProperty;
   1.106 +	RPointerArray<CPermanentFileStore> iZArrayOfStores;
   1.107 +	/// Used to distinguish variant specific feature from the default. 
   1.108 +	TUint8 iPatchableConst;
   1.109 +	};
   1.110 +	
   1.111 +#endif