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