smf/smfcredentialmgr/smfcredmgrclient/smfcredmgrclient.h
changeset 24 1cee9f1b95e0
parent 14 a469c0e6e7fb
child 26 83d6a149c755
equal deleted inserted replaced
23:574948b60dab 24:1cee9f1b95e0
    34 class SmfCredMgrClientStub;
    34 class SmfCredMgrClientStub;
    35 class SmfCredMgrClientStubSession;
    35 class SmfCredMgrClientStubSession;
    36 #endif
    36 #endif
    37 
    37 
    38 /**
    38 /**
       
    39  * @ingroup smf_credmgr_group
    39  * Qt wrapper class for for exporting APIs of Credential Manager server
    40  * Qt wrapper class for for exporting APIs of Credential Manager server
    40  */
    41  */
    41 class SmfCredMgrClient : public QObject
    42 class SmfCredMgrClient_EXPORT SmfCredMgrClient : public QObject
    42 	{
    43 	{
    43 	//Q_OBJECT -- todo used when signal and slots implemented
    44 	//Q_OBJECT -- todo used when signal and slots implemented
    44 public:
    45 public:
    45 
    46 
    46 	/**
    47 	/**
    47 	 * Constructor
    48 	 * Constructor
    48 	 */
    49 	 */
    49 	SmfCredMgrClient_EXPORT SmfCredMgrClient(QObject* parent = 0);
    50 	SmfCredMgrClient(QObject* parent = 0);
    50 
    51 
    51 	/**
    52 	/**
    52 	 * Destructor
    53 	 * Destructor
    53 	 */
    54 	 */
    54 	SmfCredMgrClient_EXPORT ~SmfCredMgrClient();
    55 	~SmfCredMgrClient();
    55 
    56 
    56 public:
    57 public:
    57 
    58 
    58 	/**
    59 	/**
    59 	 * API to check plugin authentication
    60 	 * API to check plugin authentication
    60 	 * @param PluginID The ID of the Plugin to be checked
    61 	 * @param PluginID The ID of the Plugin to be checked
    61 	 * @return The boolean value-TRUE if authenticated, FALSE if not
    62 	 * @return The boolean value-TRUE if authenticated, FALSE if not
    62 	 */
    63 	 */
    63 	SmfCredMgrClient_EXPORT bool
    64 	bool CheckPluginAuthentication(QString PluginID) const;
    64 	CheckPluginAuthentication(QString PluginID) const;
       
    65 
    65 
    66 	/**
    66 	/**
    67 	 * API to get the Auth Data set, eg:OAuth_RequestToken; OAuth_AccessToken
    67 	 * API to get the Auth Data set, eg:OAuth_RequestToken; OAuth_AccessToken
    68 	 * @param RegToken Registration Token obtained from SMF while storing this Auth Data set
    68 	 * @param RegToken Registration Token obtained from SMF while storing this Auth Data set
    69 	 * @param Validity Time by which the Auth set will expire
    69 	 * @param Validity Time by which the Auth set will expire
    70 	 * @param AuthDataSet The Auth Token Set for the plugin, this Api would fill this parameter
    70 	 * @param AuthDataSet The Auth Token Set for the plugin, this Api would fill this parameter
    71 	 *   so the caller of The API must create space for SmfAuthParams
    71 	 *   so the caller of The API must create space for SmfAuthParams
    72 	 * @return boolean Value if the reg token is still valid
    72 	 * @return boolean Value if the reg token is still valid
    73 	 */
    73 	 */
    74 	SmfCredMgrClient_EXPORT bool AuthDataSet(QString RegToken,
    74 	bool AuthDataSet(QString RegToken,QDateTime Validity, SmfAuthParams& AuthDataSet) const;
    75 			QDateTime Validity, SmfAuthParams& AuthDataSet) const;
       
    76 
    75 
    77 	/**
    76 	/**
    78 	 * API to get list of URLs which plugin can access
    77 	 * API to get list of URLs which plugin can access
    79 	 * @param PluginID The ID of the Plugin whose corresponding list of URLs to be retrieved
    78 	 * @param PluginID The ID of the Plugin whose corresponding list of URLs to be retrieved
    80 	 * @return The URL list
    79 	 * @return The URL list
    81 	 */
    80 	 */
    82 	SmfCredMgrClient_EXPORT QList<QUrl> URLList(QString PluginID) const;
    81 	QList<QUrl> URLList(QString PluginID) const;
    83 
    82 
    84 	/**
    83 	/**
    85 	 * API to get the list of authenticated plugins
    84 	 * API to get the list of authenticated plugins
    86 	 * @param RegistrationToken The token that validates a list of such plugins.
    85 	 * @param RegistrationToken The token that validates a list of such plugins.
    87 	 * @return The list of authenticated plugins
    86 	 * @return The list of authenticated plugins
    88 	 */
    87 	 */
    89 	SmfCredMgrClient_EXPORT QStringList AuthenticatedPluginList(
    88 	QStringList AuthenticatedPluginList(QString RegistrationToken) const;
    90 			QString RegistrationToken) const;
       
    91 
    89 
    92 	/**
    90 	/**
    93 	 * API to generate NONCE token
    91 	 * API to generate NONCE token
    94 	 * @param Length Lenth of the NONCE tobe generated
    92 	 * @param Length Lenth of the NONCE tobe generated
    95 	 * @return The generated NONCE. This is never zero, the minimum length is 12.
    93 	 * @return The generated NONCE. This is never zero, the minimum length is 12.
    96 	 */
    94 	 */
    97 	SmfCredMgrClient_EXPORT QString GenerateNONCE(const qint64 Length);
    95 	QString GenerateNONCE(const qint64 Length);
    98 
    96 
    99 	/**
    97 	/**
   100 	 * API to update the list of authenticated plugins-add, remove, update to plugins
    98 	 * API to update the list of authenticated plugins-add, remove, update to plugins
   101 	 * @param NewPluginID ID of the new plugin 
    99 	 * @param NewPluginID ID of the new plugin
   102 	 * @param Flag flag to enable or disable the plugin
   100 	 * @param Flag flag to enable or disable the plugin
   103 	 * @param OldPluginID ID of the old plugin to be replaced
   101 	 * @param OldPluginID ID of the old plugin to be replaced
   104 	 * @todo - should return an error code to indicate error while changing the list.
   102 	 * @todo - should return an error code to indicate error while changing the list.
   105 	 */
   103 	 */
   106 	SmfCredMgrClient_EXPORT void ChangePluginIDList(QString NewPluginID,
   104 	void ChangePluginIDList(QString NewPluginID,bool Flag, QString OldPluginID);
   107 			bool Flag, QString OldPluginID);
       
   108 	/**
   105 	/**
   109 	 * API to store all data related to an auth app i.e URL list for Plugins, List of Plugins.etc.
   106 	 * API to store all data related to an auth app i.e URL list for Plugins, List of Plugins.etc.
   110 	 * @param Set The auth Key set
   107 	 * @param Set The auth Key set
   111 	 * @param Validity time by which the Auth set will expire
   108 	 * @param Validity time by which the Auth set will expire
   112 	 * @param URLList The URL list to be set
   109 	 * @param URLList The URL list to be set
   113 	 * @param PluginList The plugin list to be set
   110 	 * @param PluginList The plugin list to be set
   114 	 * @param AuthAppId The Authentication Application Id
   111 	 * @param AuthAppId The Authentication Application Id
   115 	 * @param Flag flag to enable or disable the plugins
   112 	 * @param Flag flag to enable or disable the plugins
   116 	 * @return The registration token that completes authentication, its a NULL string if the 
   113 	 * @return The registration token that completes authentication, its a NULL string if the
   117 	 *   API fails due to any wrong argument
   114 	 *   API fails due to any wrong argument
   118 	 */
   115 	 */
   119 	SmfCredMgrClient_EXPORT QString StoreAuthData(SmfAuthParams Set,
   116 	QString StoreAuthData(SmfAuthParams Set,
   120 			QDateTime Validity, QList<QUrl> URLList, QStringList PluginList,
   117 			QDateTime Validity, QList<QUrl> URLList, QStringList PluginList,
   121 			QString AuthAppId, bool Flag);
   118 			QString AuthAppId, bool Flag);
   122 
   119 
   123 	/**
   120 	/**
   124 	 * API to store RSA Keys
   121 	 * API to store RSA Keys
   125 	 * @param KeyLabel First key of the key pair
   122 	 * @param KeyLabel First key of the key pair
   126 	 * @param Keydata  Other key of the key pair
   123 	 * @param Keydata  Other key of the key pair
   127 	 * @param Validity time by which the key set will expire
   124 	 * @param Validity time by which the key set will expire
   128 	 * @return The Label of key pair
   125 	 * @return The Label of key pair
   129 	 */
   126 	 */
   130 	SmfCredMgrClient_EXPORT QString StoreRSAKeys(const QString KeyLabel,
   127 	QString StoreRSAKeys(const QString KeyLabel,
   131 			const QString Keydata, const QDateTime Validity);
   128 			const QString Keydata, const QDateTime Validity);
   132 
   129 
   133 	/**
   130 	/**
   134 	 * API to Sign the message
   131 	 * API to Sign the message
   135 	 * @param Message The message to be signed
   132 	 * @param Message The message to be signed
   137 	 * 				returned while storeRSAKeys(), if signature method is HMAC-SHA1 key
   134 	 * 				returned while storeRSAKeys(), if signature method is HMAC-SHA1 key
   138 	 * 				must the value to sign the message with
   135 	 * 				must the value to sign the message with
   139 	 * @param Signature The signed message is an output argument
   136 	 * @param Signature The signed message is an output argument
   140 	 * @param AlgorithmUsed The algorithm used for signing
   137 	 * @param AlgorithmUsed The algorithm used for signing
   141 	 * return Smf defined errorcode
   138 	 * return Smf defined errorcode
   142 	 * @todo - RSA Signing is falgged-put for time being. 
   139 	 * @todo - RSA Signing is falgged-put for time being.
   143 	 */
   140 	 */
   144 	SmfCredMgrClient_EXPORT SMFCredMgrErrorCode SignMessage(QString Message,
   141 	SMFCredMgrErrorCode SignMessage(QString Message,
   145 			QString Key, QString& Signature, SmfSignatureMethod AlgorithmUsed);
   142 			QString Key, QString& Signature, SmfSignatureMethod AlgorithmUsed);
   146 	/**
   143 	/**
   147 	 * API To delete the RSA Key from the Key Store 
   144 	 * API To delete the RSA Key from the Key Store
   148 	 * @param KeyLabel The Label of key pair. This is the value returned while StoreRSAKeys().
   145 	 * @param KeyLabel The Label of key pair. This is the value returned while StoreRSAKeys().
   149 	 */
   146 	 */
   150 	SmfCredMgrClient_EXPORT void DeleteRSAKey(QString KeyLabel);
   147 	void DeleteRSAKey(QString KeyLabel);
   151 
   148 
   152 private:
   149 private:
   153 	/**
   150 	/**
   154 	 * Handle to private implementation class.
   151 	 * Handle to private implementation class.
   155 	 */
   152 	 */
   156 #ifdef Q_OS_SYMBIAN
   153 #ifdef Q_OS_SYMBIAN
   157 	CSmfCredMgrClientSymbian* m_SmfClientPrivate;
   154 	CSmfCredMgrClientSymbian* m_SmfClientPrivate;
   158 	friend class CSmfCredMgrClientSymbian;
   155 	//friend class CSmfCredMgrClientSymbian;
   159 #endif
   156 #endif
   160 
   157 
   161 	};
   158 	};
   162 
   159 
   163 #endif /* SMFCREDMGRCLIENT_H_ */
   160 #endif /* SMFCREDMGRCLIENT_H_ */