os/security/cryptoservices/certificateandkeymgmt/inc/swicertstore.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) 2005-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
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
/**
sl@0
    20
 @file
sl@0
    21
 @internalTechnology
sl@0
    22
*/
sl@0
    23
sl@0
    24
#ifndef __SWICERTSTORE_H__
sl@0
    25
#define __SWICERTSTORE_H__
sl@0
    26
sl@0
    27
#include <mctcertstore.h>
sl@0
    28
sl@0
    29
class CSWICertStoreImpl;
sl@0
    30
class CSWICertStoreToken;
sl@0
    31
sl@0
    32
/**  Addtional meta-data information about the Certificate */
sl@0
    33
class TCertMetaInfo
sl@0
    34
	{
sl@0
    35
public:
sl@0
    36
	TCapabilitySet iCapabilities;
sl@0
    37
	TBool iIsMandatory;
sl@0
    38
	TBool iIsSystemUpgrade;
sl@0
    39
	};
sl@0
    40
sl@0
    41
// The certificate is marked for mandatory flag
sl@0
    42
const TUint8 KMandatory = 0x00;
sl@0
    43
// The certificate is marked for System Upgrade flag
sl@0
    44
const TUint8 KSystemUpgrade = 0x01;
sl@0
    45
sl@0
    46
sl@0
    47
/**
sl@0
    48
 * SWI Cert store token type UID.
sl@0
    49
 */
sl@0
    50
const TUint KSWICertStoreTokenTypeUid = 0x102042BA;
sl@0
    51
sl@0
    52
/**
sl@0
    53
 * The software install certificate store.
sl@0
    54
 *
sl@0
    55
 * To support platform security, software install uses an independant ROM-based
sl@0
    56
 * certificate store to find root certs.  In addition to the usual meta-data,
sl@0
    57
 * this also associates a set of capabilities and a mandatory flag with each
sl@0
    58
 * cert.
sl@0
    59
 *
sl@0
    60
 * Although this class supports the MCTCertStore interface, the implementation
sl@0
    61
 * is synchronous.
sl@0
    62
 */
sl@0
    63
NONSHARABLE_CLASS(CSWICertStore) : protected CBase, public MCTCertStore
sl@0
    64
	{
sl@0
    65
public:
sl@0
    66
	/// Create token type, for use by swicertstoreplugin
sl@0
    67
	IMPORT_C static CCTTokenType* CreateTokenTypeL();
sl@0
    68
sl@0
    69
	/// Create the cert store interface directly without going through ecom
sl@0
    70
	IMPORT_C static CSWICertStore* NewL(RFs& aFs);
sl@0
    71
sl@0
    72
	/// Create the cert store interface, called by token's GetInterface() method
sl@0
    73
	static CSWICertStore* NewL(CSWICertStoreToken& aToken, RFs& aFs);
sl@0
    74
sl@0
    75
	// Implementation of MCTTokenInterface
sl@0
    76
	virtual MCTToken& Token();
sl@0
    77
	
sl@0
    78
	// Implementation of MCTCertStore
sl@0
    79
	virtual void List(RMPointerArray<CCTCertInfo>& aCerts,
sl@0
    80
					  const CCertAttributeFilter& aFilter, TRequestStatus& aStatus);
sl@0
    81
	virtual void CancelList();
sl@0
    82
	virtual void GetCert(CCTCertInfo*& aCertInfo, const TCTTokenObjectHandle& aHandle, 
sl@0
    83
						 TRequestStatus& aStatus);		
sl@0
    84
	virtual void CancelGetCert();
sl@0
    85
	virtual void Applications(const CCTCertInfo& aCertInfo, RArray<TUid>& aAplications,
sl@0
    86
							  TRequestStatus& aStatus);
sl@0
    87
	virtual void CancelApplications();
sl@0
    88
	virtual void IsApplicable(const CCTCertInfo& aCertInfo, TUid aApplication, 
sl@0
    89
							  TBool& aIsApplicable, TRequestStatus& aStatus);
sl@0
    90
	virtual void CancelIsApplicable();
sl@0
    91
	virtual void Trusted(const CCTCertInfo& aCertInfo, TBool& aTrusted, 
sl@0
    92
						 TRequestStatus& aStatus);
sl@0
    93
	virtual void CancelTrusted();
sl@0
    94
	virtual void Retrieve(const CCTCertInfo& aCertInfo, TDes8& aEncodedCert, 
sl@0
    95
						  TRequestStatus& aStatus);
sl@0
    96
	virtual void CancelRetrieve();
sl@0
    97
sl@0
    98
	// Addtional meta-data accessors
sl@0
    99
	IMPORT_C const TCertMetaInfo& CertMetaInfoL(const CCTCertInfo& aCertInfo);
sl@0
   100
	
sl@0
   101
private:
sl@0
   102
	// Implementation of MCTTokenInterface
sl@0
   103
	virtual void DoRelease();
sl@0
   104
sl@0
   105
private:
sl@0
   106
	CSWICertStore(CSWICertStoreToken& aToken);
sl@0
   107
	virtual ~CSWICertStore();
sl@0
   108
	void ConstructL(RFs& aFs);
sl@0
   109
sl@0
   110
private:
sl@0
   111
	CSWICertStoreToken& iToken;
sl@0
   112
	CSWICertStoreImpl* iImpl;
sl@0
   113
	};
sl@0
   114
sl@0
   115
#endif