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