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