os/security/cryptoservices/certificateandkeymgmt/swicertstore/CSWICertStoreImpl.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of the License "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description: 
sl@0
    15
* CSWICertStoreImpl class implementation
sl@0
    16
*
sl@0
    17
*/
sl@0
    18
sl@0
    19
sl@0
    20
/**
sl@0
    21
 @file 
sl@0
    22
 @internalTechnology
sl@0
    23
*/
sl@0
    24
 
sl@0
    25
#ifndef __CSWICERTSTOREIMPL_H__
sl@0
    26
#define __CSWICERTSTOREIMPL_H__
sl@0
    27
sl@0
    28
#include <e32std.h>
sl@0
    29
#include <e32base.h>
sl@0
    30
#include <s32file.h>
sl@0
    31
#include <ct/rmpointerarray.h>
sl@0
    32
#include <e32property.h>
sl@0
    33
sl@0
    34
class MCTToken;
sl@0
    35
class CCTCertInfo;
sl@0
    36
class CSWICertStoreEntryList;
sl@0
    37
class CCertAttributeFilter;
sl@0
    38
class TCTTokenObjectHandle;
sl@0
    39
class CSWICertStoreEntry;
sl@0
    40
class TCertMetaInfo;
sl@0
    41
sl@0
    42
/**
sl@0
    43
 * This class implements the guts of the SWI cert store.  It is mainly a cut
sl@0
    44
 * down version of the filetokens cert store server.
sl@0
    45
 */
sl@0
    46
NONSHARABLE_CLASS(CSWICertStoreImpl) : public CActive
sl@0
    47
	{
sl@0
    48
public:
sl@0
    49
	static CSWICertStoreImpl* NewL(MCTToken& aToken, RFs& aFs);
sl@0
    50
	virtual ~CSWICertStoreImpl();
sl@0
    51
sl@0
    52
public:
sl@0
    53
	// For MCTCertStore
sl@0
    54
	void ListL(RMPointerArray<CCTCertInfo>& aCerts,
sl@0
    55
			   const CCertAttributeFilter& aFilter);
sl@0
    56
	CCTCertInfo* GetCertL(const TCTTokenObjectHandle& aHandle);		
sl@0
    57
	void ApplicationsL(const TCTTokenObjectHandle& aHandle, RArray<TUid>& aAplications);
sl@0
    58
	TBool IsApplicableL(const TCTTokenObjectHandle& aHandle, TUid aApplication);
sl@0
    59
	TBool TrustedL(const TCTTokenObjectHandle& aHandle);
sl@0
    60
	void RetrieveL(const TCTTokenObjectHandle& aHandle, TDes8& aEncodedCert);
sl@0
    61
sl@0
    62
	// Addtional meta-data accessors
sl@0
    63
	const TCertMetaInfo& CertMetaInfoL(const TCTTokenObjectHandle& aHandle) const;	
sl@0
    64
	
sl@0
    65
private:
sl@0
    66
	CSWICertStoreImpl(MCTToken& aToken, RFs& aFs);
sl@0
    67
	void ConstructL();
sl@0
    68
sl@0
    69
	// Open the Writable certstore and setup the iCEntryList
sl@0
    70
	void SetupWritableCertStoreL();
sl@0
    71
sl@0
    72
	// Open the ROM certstore and setup the iZEntryList
sl@0
    73
	void SetupROMCertStoreL();
sl@0
    74
	void SetupCompositeROMCertStoreL();
sl@0
    75
	static void FilterCertificateListL(RMPointerArray<CCTCertInfo>& aCerts,
sl@0
    76
			   const CCertAttributeFilter& aFilter, const CSWICertStoreEntryList& aEntryList);
sl@0
    77
	static void AddIfMatchesFilterL(RMPointerArray<CCTCertInfo>& aCerts,
sl@0
    78
			   const CCertAttributeFilter& aFilter, const CSWICertStoreEntry& aEntry);
sl@0
    79
	const CSWICertStoreEntry* GetCSWICertStoreEntryL(const TCTTokenObjectHandle& aHandle, TBool& aCEntryHandle) const;
sl@0
    80
	void MergeCertificateEntryListsL(const CSWICertStoreEntryList& aSourceList, TBool aIsZEntryList = EFalse );
sl@0
    81
	
sl@0
    82
protected:	//	From CActive
sl@0
    83
	void DoCancel();
sl@0
    84
	void RunL();
sl@0
    85
sl@0
    86
private:
sl@0
    87
	/// Cert store token
sl@0
    88
	MCTToken& iToken;
sl@0
    89
	
sl@0
    90
	/// File server session
sl@0
    91
	RFs& iFs;
sl@0
    92
	
sl@0
    93
	/// Persistent store containg the certs
sl@0
    94
	CPermanentFileStore* iCStore;
sl@0
    95
	CPermanentFileStore* iZStore;
sl@0
    96
sl@0
    97
	/// The list of certificates contained in the store.
sl@0
    98
	CSWICertStoreEntryList* iCEntryList;
sl@0
    99
	CSWICertStoreEntryList* iZEntryList;
sl@0
   100
	
sl@0
   101
	TInt iCertIndex;
sl@0
   102
	RProperty iSwicertstoreProperty;
sl@0
   103
	RPointerArray<CPermanentFileStore> iZArrayOfStores;
sl@0
   104
	/// Used to distinguish variant specific feature from the default. 
sl@0
   105
	TUint8 iPatchableConst;
sl@0
   106
	};
sl@0
   107
	
sl@0
   108
#endif