epoc32/include/authserver/authplugininterface.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
/*
williamr@4
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     3
* All rights reserved.
williamr@4
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of the License "Eclipse Public License v1.0"
williamr@4
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     8
*
williamr@4
     9
* Initial Contributors:
williamr@4
    10
* Nokia Corporation - initial contribution.
williamr@4
    11
*
williamr@4
    12
* Contributors:
williamr@4
    13
*
williamr@4
    14
* Description: 
williamr@4
    15
* CAuthPluginInterface 
williamr@4
    16
*
williamr@4
    17
*/
williamr@4
    18
williamr@4
    19
williamr@4
    20
/**
williamr@4
    21
 @file 
williamr@4
    22
 @publishedAll
williamr@4
    23
 @released
williamr@4
    24
*/
williamr@4
    25
williamr@4
    26
#ifndef AUTHPLUGININTERFACE_H
williamr@4
    27
#define AUTHPLUGININTERFACE_H
williamr@4
    28
williamr@4
    29
williamr@4
    30
#include <authserver/authtypes.h>
williamr@4
    31
#include <ecom/implementationinformation.h>
williamr@4
    32
williamr@4
    33
namespace AuthServer
williamr@4
    34
{
williamr@4
    35
williamr@4
    36
/// The interface UID for the authentication plugin interface
williamr@4
    37
const TUid KCAuthPluginInterfaceUid = { 0x102740FE }; 
williamr@4
    38
williamr@4
    39
williamr@4
    40
/**
williamr@4
    41
 * The ECOM interface for authentication plugins. An authentication plugin is
williamr@4
    42
 * used to help identify the current device holder. When a plugin is asked to
williamr@4
    43
 * identify the holder, it interacts with the user and potentially hardware or
williamr@4
    44
 * services provided by other servers. The plugin then generates some data
williamr@4
    45
 * which is unique and repeatable for the input recieved. This data should
williamr@4
    46
 * not be persisted on the device in any form that can easily be used to
williamr@4
    47
 * recover the data.
williamr@4
    48
 *
williamr@4
    49
 * For example, a plugin might request a PIN number from the user. The plugin
williamr@4
    50
 * will take the number, perhaps compare the hash of the number against the
williamr@4
    51
 * hashes recorded during training and if a match is found return the identity
williamr@4
    52
 * along with some unique data associated with it.
williamr@4
    53
 *
williamr@4
    54
 */	
williamr@4
    55
class CAuthPluginInterface : public CBase
williamr@4
    56
	{
williamr@4
    57
public:
williamr@4
    58
williamr@4
    59
	/**
williamr@4
    60
	 * @return the id of the plugin. This should be the ECOM implementation id.
williamr@4
    61
	 **/
williamr@4
    62
	virtual TPluginId Id() const = 0;
williamr@4
    63
williamr@4
    64
	/**
williamr@4
    65
	 *
williamr@4
    66
	 * @return the name of the plugin.
williamr@4
    67
	 * 
williamr@4
    68
	 **/
williamr@4
    69
	virtual const TPtrC& Name() const = 0;
williamr@4
    70
	
williamr@4
    71
	/**
williamr@4
    72
	 *
williamr@4
    73
	 * @return a description of the plugin.
williamr@4
    74
	 * 
williamr@4
    75
	 **/
williamr@4
    76
	virtual const TPtrC& Description() const = 0;
williamr@4
    77
williamr@4
    78
	/**
williamr@4
    79
	 *
williamr@4
    80
	 * @return the minimum entropy of the plugin.
williamr@4
    81
	 * 
williamr@4
    82
	 **/
williamr@4
    83
	virtual TEntropy MinEntropy() const = 0;
williamr@4
    84
	
williamr@4
    85
	/**
williamr@4
    86
	 *
williamr@4
    87
	 * @return the rate of false positive identifications.
williamr@4
    88
	 * 
williamr@4
    89
	 **/
williamr@4
    90
	virtual TPercentage FalsePositiveRate() const = 0;
williamr@4
    91
williamr@4
    92
	/**
williamr@4
    93
	 *
williamr@4
    94
	 * @return the rate of false negative identifications.
williamr@4
    95
	 * 
williamr@4
    96
	 **/
williamr@4
    97
	virtual TPercentage FalseNegativeRate() const = 0;
williamr@4
    98
williamr@4
    99
	/**
williamr@4
   100
	 *
williamr@4
   101
	 * @return the type of plugin
williamr@4
   102
	 * 
williamr@4
   103
	 **/
williamr@4
   104
	virtual TAuthPluginType Type() const = 0;
williamr@4
   105
williamr@4
   106
	/**
williamr@4
   107
	 * Performs actions required to identify the current device holder. 
williamr@4
   108
	 *
williamr@4
   109
	 * For details see the reference/test implementation of a knowledge-type 
williamr@4
   110
	 * plugin called the pinplugin.
williamr@4
   111
	 *
williamr@4
   112
	 * @param aId in the event of a successfull call, aId will be set to the
williamr@4
   113
	 * id of the identity. The value is not modified otherwise. It should be
williamr@4
   114
	 * noted that a successful call includes the possibility of not
williamr@4
   115
	 * recognising the user in which case aId should be set to
williamr@4
   116
	 * KUnknownIdentity.
williamr@4
   117
	 *
williamr@4
   118
	 * @param aClientMessage A displayable text string parameter for authentication
williamr@4
   119
	 * requests.It shall be passed to plug-ins to display to the users.
williamr@4
   120
	 *
williamr@4
   121
	 * @param aResult in the event of a successfull call, aResult contains the
williamr@4
   122
	 * data generated from the identification process. This data is used by
williamr@4
   123
	 * the authentication server to generate a transient key which in turn is
williamr@4
   124
	 * used to decrypt the identities protection key. If the call was
williamr@4
   125
	 * unsuccessful or the user is unknown no buffer will be created. Ownership of 
williamr@4
   126
	 * the buffer is transfered to the caller.
williamr@4
   127
	 *
williamr@4
   128
	 * @param aRequest the request status through which the caller will be
williamr@4
   129
	 * notified of completion. Upon completion, the status value will be one of the
williamr@4
   130
	 * following :
williamr@4
   131
	 * KErrNone if the identification process is successful.
williamr@4
   132
	 * KErrAuthServPluginCancelled if the user cancels the identification process for
williamr@4
   133
	 * this plugin.
williamr@4
   134
	 * KErrAuthServPluginQuit if the user quits the whole identification
williamr@4
   135
	 * process.
williamr@4
   136
	 * ... or any of the system wide error codes.
williamr@4
   137
	 **/
williamr@4
   138
williamr@4
   139
williamr@4
   140
	virtual void Identify(TIdentityId& aId, const TDesC& aClientMessage, 
williamr@4
   141
						  HBufC8*& aResult, TRequestStatus& aRequest) = 0;
williamr@4
   142
williamr@4
   143
	/**
williamr@4
   144
	 * Cancel the current action. This method must complete with KErrCancel
williamr@4
   145
	 * any outstanding asyncronous requests such as Train or Identify.
williamr@4
   146
	 **/
williamr@4
   147
williamr@4
   148
williamr@4
   149
	virtual void Cancel() = 0;
williamr@4
   150
	
williamr@4
   151
	/**
williamr@4
   152
	 * This method tells the plugin to operate in training mode. After the
williamr@4
   153
	 * successful this method the plugin should be able to correctly identify
williamr@4
   154
	 * the specified identity using the Identify method. If the plugin already
williamr@4
   155
	 * has existing training data for the identity then the data should be
williamr@4
   156
	 * replaced. Care should be taken to allow the user to cancel or quit the
williamr@4
   157
	 * training without losing the existing training.  
williamr@4
   158
	 * 
williamr@4
   159
	 * @param aId the identity for whom to train the plugin. This allows the
williamr@4
   160
	 * plugin to persist training data associated with the identity and delete
williamr@4
   161
	 * or update that data later on.
williamr@4
   162
	 *
williamr@4
   163
	 * @param aResult this buffer will be filled with data that matches the
williamr@4
   164
	 * current device holder. This should be the same data as is returned by
williamr@4
   165
	 * the Identify method for the same identity. Ownership of the buffer is 
williamr@4
   166
	 * transfered to the caller.
williamr@4
   167
	 *
williamr@4
   168
	 * @param aRequest the request status through which the caller will be
williamr@4
   169
	 * notified of completion. Upon completion the status value will be one of the
williamr@4
   170
	 * following :
williamr@4
   171
	 * KErrNone if the training process is successful.
williamr@4
   172
	 * KErrAuthServPluginCancelled if the user cancels the training process for
williamr@4
   173
	 * this plugin.
williamr@4
   174
	 * KErrAuthServPluginQuit if the user quits the whole training
williamr@4
   175
	 * process.
williamr@4
   176
	 * ... or any of the system wide error codes.
williamr@4
   177
	 **/
williamr@4
   178
williamr@4
   179
williamr@4
   180
	 virtual void Train(TIdentityId aId, HBufC8*& aResult,
williamr@4
   181
						TRequestStatus& aRequest) = 0;
williamr@4
   182
williamr@4
   183
	/**
williamr@4
   184
	 * @return true if the plugin can be used for identification or training
williamr@4
   185
	 * purposes without further user intervention. 
williamr@4
   186
	 **/
williamr@4
   187
williamr@4
   188
williamr@4
   189
	virtual TBool IsActive() const = 0;
williamr@4
   190
	
williamr@4
   191
	/**
williamr@4
   192
	 * Remove any stored training data for the specified identity. This is
williamr@4
   193
	 * used if an identity is being removed from the device. No user
williamr@4
   194
	 * interaction should take place as a result of this call.
williamr@4
   195
	 *
williamr@4
   196
	 * @param aId the identity for whom to remove any persisted training data.
williamr@4
   197
	 *
williamr@4
   198
	 * @return KErrNone if the operation is successful.
williamr@4
   199
	 * @return KErrAuthServNoSuchIdentity if the TIdentityId wasn't recognised.
williamr@4
   200
	 * @return ... or any of the system wide error codes.
williamr@4
   201
	 **/
williamr@4
   202
williamr@4
   203
williamr@4
   204
	 virtual TInt Forget(TIdentityId aId) = 0;
williamr@4
   205
williamr@4
   206
	/**
williamr@4
   207
	 * Pretend the device holder has identified themselves using a default
williamr@4
   208
	 * entry. For example, a pin number plugin would return the same data as
williamr@4
   209
	 * if the holder had entered the default pin. This call is used during the
williamr@4
   210
	 * creation of the initial device identity and allows the device to be
williamr@4
   211
	 * operated without the user being forced to train plugins the first time
williamr@4
   212
	 * the device is started. No user interaction should take place as a
williamr@4
   213
	 * result of this call.
williamr@4
   214
	 *
williamr@4
   215
	 * Only plugins of type EAuthKnowledge should support default
williamr@4
   216
	 * data. Plugins of other types will be ignored.
williamr@4
   217
	 *
williamr@4
   218
	 * @param aId The identity that will be registered using the default data. 
williamr@4
   219
	 * 
williamr@4
   220
	 * @param aOutputBuf This buffer should be filled with the data that would
williamr@4
   221
	 * be generated if the phone holder identified themselves using the
williamr@4
   222
	 * default manner. Ownership of the buffer is transfered to the caller. 
williamr@4
   223
	 *
williamr@4
   224
	 * @return KErrNone if the plugin supports default data.
williamr@4
   225
	 * @return KErrNotSupported if the plugin doesn't support default data.
williamr@4
   226
	 * @return ... or any of the system wide error codes.
williamr@4
   227
	 **/
williamr@4
   228
williamr@4
   229
williamr@4
   230
	 virtual TInt DefaultData(TIdentityId aId, HBufC8*& aOutputBuf) = 0;
williamr@4
   231
williamr@4
   232
	/**
williamr@4
   233
	 * This method tells the plugin to remove the training data held for the given identity 
williamr@4
   234
	 * and to regenerate it using the supplied registration data. The intent of this method 
williamr@4
   235
	 * is to allow a backend reset of user credentials in situations where the user is not 
williamr@4
   236
	 * able to provide the credentials for some reason (for instance the user has forgotten 
williamr@4
   237
	 * the password). Note that no user interaction should take place as a result of this call. 
williamr@4
   238
	 * Since the registration data may not be usable by all plugin types it is expected that only 
williamr@4
   239
	 * EAuthKnowledge type plugins (those based on pins, passphrases, etc.) use this data for 
williamr@4
   240
	 * registering the user and return the result.
williamr@4
   241
	 *
williamr@4
   242
	 * @param aId The identity whose training data should be reset. 
williamr@4
   243
	 * 
williamr@4
   244
	 * @param aRegistrationData The data that can be used to register the identity. 
williamr@4
   245
	 * This data is meaningful for EAuthKnowledge type plugins. Other plugins may choose to 
williamr@4
   246
	 * ignore this parameter. An empty descriptor signifies the absence of registration data.
williamr@4
   247
	 *
williamr@4
   248
	 * @param aResult This buffer will be filled with data that matches the specified identity. 
williamr@4
   249
	 * This should be the same data subsequently returned by the Identify method for the same identity. 
williamr@4
   250
	 * Note that plugins that aren't supplied registration data or those that don't use the supplied 
williamr@4
   251
	 * registration data for the reset can return NULL. Ownership of the buffer is transfered to 
williamr@4
   252
	 * the caller.
williamr@4
   253
	 *
williamr@4
   254
	 * @return KErrNone if the plugin is successfully able to either remove and/or reset the training data.
williamr@4
   255
	 * @return KErrNotSupported if the plugin doesn't support a reset functionality.
williamr@4
   256
	 * @return ... or any of the system wide error codes.
williamr@4
   257
	 **/
williamr@4
   258
williamr@4
   259
williamr@4
   260
	 virtual TInt Reset(TIdentityId aId, const TDesC& aRegistrationData, 
williamr@4
   261
			 			HBufC8*& aResult) = 0;
williamr@4
   262
	
williamr@4
   263
	/**
williamr@4
   264
	 * 
williamr@4
   265
	 * Destructor.
williamr@4
   266
	 * 
williamr@4
   267
	 **/
williamr@4
   268
williamr@4
   269
williamr@4
   270
	virtual ~CAuthPluginInterface() {};
williamr@4
   271
	
williamr@4
   272
};	
williamr@4
   273
williamr@4
   274
} // namespace
williamr@4
   275
williamr@4
   276
#endif