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