cryptoservices/certificateandkeymgmt/inc/certificateapps_v2.h
changeset 0 2c201484c85f
child 8 35751d3474b7
equal deleted inserted replaced
-1:000000000000 0:2c201484c85f
       
     1 /*
       
     2 * Copyright (c) 1998-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 * CERTIFICATEAPPS.H
       
    16 * CCertificateAppInfoManager class implementation
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 /**
       
    24  @file 
       
    25  @publishedAll
       
    26  @released 
       
    27 */
       
    28  
       
    29 #ifndef __CERTIFICATEAPPS_H__
       
    30 #define __CERTIFICATEAPPS_H__
       
    31 
       
    32 #include <f32file.h>
       
    33 #include <s32file.h>
       
    34 #include <mctcertapps.h>
       
    35 
       
    36 /**
       
    37  * This class is used to access a persistent store which contains the available
       
    38  * applications on a device.  It provides an interface to add and retrieve
       
    39  * applications.
       
    40  * 
       
    41  * @publishedAll
       
    42  * @released
       
    43  */
       
    44 class CCertificateAppInfoManager : public CBase
       
    45 	{
       
    46 public:
       
    47 	/**
       
    48 	* Creates a new instance of the app info manager and puts a pointer to it onto the cleanup stack.
       
    49 	*
       
    50 	* @return	A new CCertificateAppInfoManager object.
       
    51 	*/
       
    52 	IMPORT_C static CCertificateAppInfoManager* NewLC();
       
    53 	
       
    54 	/**
       
    55 	* Creates a new instance of the app info manager.
       
    56 	* 
       
    57 	* @return	A new CCertificateAppInfoManager object.
       
    58 	*/
       
    59 	IMPORT_C static CCertificateAppInfoManager* NewL();
       
    60 
       
    61 	/**
       
    62 	 * Creates a new instance of the app info manager.
       
    63 	 * 
       
    64 	 * @deprecated	Clients should use the no-argument version.
       
    65 	 */
       
    66 	IMPORT_C static CCertificateAppInfoManager* NewLC(RFs& aFs, TBool aOpenedForWrite);
       
    67 	
       
    68 	/**
       
    69 	 * Creates a new instance of the app info manager.
       
    70 	 * 
       
    71 	 * @deprecated	Clients should use the no-argument version.
       
    72 	 */
       
    73 	IMPORT_C static CCertificateAppInfoManager* NewL(RFs& aFs, TBool aOpenedForWrite);
       
    74 
       
    75 	/** Virtual destructor. Frees all resources owned by the object, prior to its destruction.
       
    76   	*/
       
    77 	IMPORT_C virtual ~CCertificateAppInfoManager();
       
    78 
       
    79 private:
       
    80 	CCertificateAppInfoManager();
       
    81 	void ConstructL();
       
    82 
       
    83 public:
       
    84 	/**
       
    85 	 * Adds a new application.
       
    86 	 * 
       
    87 	 * @param aClient				The new application to add.
       
    88 	 * @capability WriteDeviceData	The caller requires the WriteDeviceData capability.
       
    89 	 * @leave KErrPermissionDenied	If the caller does not have the required capability.
       
    90 	 */
       
    91 	IMPORT_C void AddL(const TCertificateAppInfo& aClient);
       
    92 	
       
    93 	/**
       
    94 	 * Removes an existing application.
       
    95 	 * 
       
    96 	 * @param aUid					The UID of the application to remove.
       
    97 	 * @capability WriteDeviceData	The caller requires the WriteDeviceData capability.
       
    98 	 * @leave KErrPermissionDenied	If the caller does not have the required capability.
       
    99 	 * @leave KErrNotFound			If there is no application matching the specified UID.
       
   100 	 */
       
   101 	IMPORT_C void RemoveL(const TUid& aUid);
       
   102 
       
   103 	/**
       
   104 	 * Gets an application by UID.
       
   105 	 *
       
   106 	 * @param aUid			The UID of the application.
       
   107 	 * @param aIndex		On return, the index of the application in the store.
       
   108 	 * @return				Information about the application if it is present.
       
   109 	 * @leave KErrNotFound	If there is no application matching the specified UID.
       
   110 	 */
       
   111 	IMPORT_C const TCertificateAppInfo& ApplicationL(const TUid& aUid, TInt& aIndex) const;
       
   112 
       
   113 	/**
       
   114 	 * Gets a list of all applications in the store.
       
   115 	 *
       
   116 	 * @return	An array containing all applications in the store.
       
   117 	 */
       
   118 	IMPORT_C const RArray<TCertificateAppInfo>& Applications() const;
       
   119 
       
   120 private:
       
   121 	MCTCertApps* iCertAppsIf;
       
   122 	/// A cache of the contents of the store 
       
   123 	RArray<TCertificateAppInfo> iClients;
       
   124 	};
       
   125 
       
   126 #endif