smf/smfcredentialmgr/smfcredmgrclient/smfcredmgrclient.cpp
author cgandhi
Mon, 11 Oct 2010 21:59:54 +0530
changeset 26 83d6a149c755
parent 24 1cee9f1b95e0
permissions -rw-r--r--
Submitting following changes - AuthApps for Last.fm and Twitter added API for checking ServiceAuthorization added for SMFCredMgrClient API added for forcefully removing credential details from SMFCredMgr Extra argument checks in SMfClient APIs APIs for service login and logout from SMFClient Redundant members removed from SmfServerSymbian DSM bug fixes Test Apps included
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     1
/**
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     2
 * Copyright (c) 2010 Sasken Communication Technologies Ltd.
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     3
 * All rights reserved.
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     5
 * under the terms of the "Eclipse Public License v1.0"
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     6
 * which accompanies  this distribution, and is available
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html"
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     8
 *
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     9
 * Initial Contributors:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    10
 * Pritam Roy Biswas, Sasken Communication Technologies Ltd - Initial contribution
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    11
 *
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    12
 * Description:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    13
 * This is the public implementation Class(Qt wrapper) for symbian client for Credential Manager server
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    14
 *
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    15
 */
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    16
#include "smfcredmgrclient.h"
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    17
#include "smfcredmgrclient_p.h"
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    18
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    19
SmfCredMgrClient::SmfCredMgrClient(QObject* Parent) :
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    20
	QObject(Parent)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    21
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    22
	//Symbian specific compilation
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    23
#ifdef Q_OS_SYMBIAN 
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    24
	QT_TRAP_THROWING(m_SmfClientPrivate = CSmfCredMgrClientSymbian::NewL(this));
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    25
#else    
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    26
	m_SmfClientPrivate = new SmfCredMgrClientStub(this);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    27
#endif
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    28
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    29
SmfCredMgrClient::~SmfCredMgrClient()
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    30
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    31
	delete m_SmfClientPrivate;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    32
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    33
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    34
QString SmfCredMgrClient::StoreAuthData(SmfAuthParams Set, QDateTime Validity,
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    35
		QList<QUrl> URLList, QStringList PluginList, QString AuthAppId,
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    36
		bool Flag)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    37
	{
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    38
	QString regToken;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    39
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    40
	if (!(Set.isEmpty() || URLList.isEmpty() || PluginList.isEmpty()
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    41
			|| AuthAppId.isEmpty() || Validity.isNull()))
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    42
		{
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    43
		QT_TRAP_THROWING( regToken = m_SmfClientPrivate->storeAuthDataL(Set, Validity, URLList,
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    44
				PluginList, AuthAppId, Flag) );
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    45
		}
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    46
	return regToken;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    47
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    48
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    49
QStringList SmfCredMgrClient::AuthenticatedPluginList(QString RegistrationToken) const
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    50
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    51
	QStringList List;
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    52
	if (!RegistrationToken.isEmpty())
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    53
		QT_TRAP_THROWING( m_SmfClientPrivate->authenticatedPluginListL(RegistrationToken, List));
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    54
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    55
	return List;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    56
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    57
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    58
QList<QUrl> SmfCredMgrClient::URLList(QString PluginID) const
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    59
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    60
	QList<QUrl> List;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    61
	if (!(PluginID.isEmpty()))
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    62
		{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    63
		QT_TRAP_THROWING ( m_SmfClientPrivate->URLListL(PluginID, List) );
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    64
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    65
	return List;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    66
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    67
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    68
QString SmfCredMgrClient::GenerateNONCE(const qint64 Length)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    69
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    70
	return m_SmfClientPrivate->generateNONCE(Length);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    71
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    72
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    73
void SmfCredMgrClient::ChangePluginIDList(QString NewPluginID, bool Flag,
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    74
		QString OldPluginID)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    75
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    76
	if (!(OldPluginID.isEmpty() || NewPluginID.isEmpty()))
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    77
		{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
    78
		QT_TRAP_THROWING (m_SmfClientPrivate->changePluginIDListL(NewPluginID, Flag, OldPluginID));
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    79
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    80
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    81
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    82
bool SmfCredMgrClient::CheckPluginAuthentication(QString PluginID) const
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    83
	{
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    84
	bool result = false;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    85
	if (!(PluginID.isEmpty()))
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    86
		{
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    87
		TBool check = EFalse;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    88
		QT_TRAP_THROWING ( check =  m_SmfClientPrivate->isPluginAuthenticatedL(PluginID) );
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    89
		if(check)
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    90
			result = true;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    91
		else
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    92
			result = false;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    93
		}
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
    94
	return result;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    95
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    96
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    97
bool SmfCredMgrClient::AuthDataSet(QString RegToken, QDateTime Validity,
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    98
		SmfAuthParams& AuthTokenSet) const
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    99
	{
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   100
	bool datastored = false;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   101
	if (!(RegToken.isEmpty() || Validity.isNull()))
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   102
		{
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   103
		TBool Flag = EFalse;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   104
		QT_TRAP_THROWING ( Flag = m_SmfClientPrivate->AuthDataSetL(RegToken, Validity, AuthTokenSet));
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   105
		if (Flag)
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   106
			datastored = true;
24
1cee9f1b95e0 taking care of credmgr for RVCT B686 compilation
cgandhi
parents: 18
diff changeset
   107
		else
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   108
			datastored = false;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   109
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   110
	else
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   111
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   112
		AuthTokenSet.clear();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   113
		}
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   114
	
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   115
	return datastored;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   116
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   117
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   118
QString SmfCredMgrClient::StoreRSAKeys(const QString KeyLabel,
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   119
		const QString keydata, const QDateTime Validity)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   120
	{
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   121
	QString retData;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   122
	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   123
	if (!(KeyLabel.isEmpty() || keydata.isEmpty()) && Validity.isValid())
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   124
		{
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   125
		QT_TRAP_THROWING ( retData = m_SmfClientPrivate->storeRSAKeysL(KeyLabel, keydata, Validity) );
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   126
		}
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   127
	return retData;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   128
	}
24
1cee9f1b95e0 taking care of credmgr for RVCT B686 compilation
cgandhi
parents: 18
diff changeset
   129
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   130
SMFCredMgrErrorCode SmfCredMgrClient::SignMessage(QString Message, QString Key,
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   131
		QString& Signature, SmfSignatureMethod AlgorithmUsed)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   132
	{
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   133
	SMFCredMgrErrorCode errorCode = SmfErrBadParameter;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   134
	if (!(Message.isEmpty() || Key.isEmpty()))
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   135
		{
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   136
		QT_TRAP_THROWING ( errorCode =  m_SmfClientPrivate->signMessageL(Message, Key, Signature,
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   137
				AlgorithmUsed) );
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents: 14
diff changeset
   138
		}
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   139
	return errorCode;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   140
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   141
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   142
void SmfCredMgrClient::DeleteRSAKey(QString KeyLabel)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   143
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   144
	if (!(KeyLabel.isEmpty()))
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   145
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   146
		m_SmfClientPrivate->deleteRSAKey(KeyLabel);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   147
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   148
	}
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   149
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   150
bool SmfCredMgrClient::CheckServiceAuthorization( const QString& AuthAppId )
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   151
	{
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   152
	bool isAuthorised = false;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   153
	if (!AuthAppId.isEmpty())
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   154
		{
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   155
		TBool Flag = EFalse;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   156
		QT_TRAP_THROWING ( Flag = m_SmfClientPrivate->CheckServiceAuthorizationL(AuthAppId));
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   157
		if (Flag)
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   158
			isAuthorised = true;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   159
		else
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   160
			isAuthorised = false;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   161
		}
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   162
	
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   163
	return isAuthorised;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   164
	}
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   165
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   166
SMFCredMgrErrorCode SmfCredMgrClient::DeleteAuthData( const QString& AuthAppId,
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   167
		const QString& RegToken, const QDateTime& Validity )
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   168
	{
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   169
	SMFCredMgrErrorCode errorCode = SmfErrBadParameter;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   170
	
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   171
	if (!(AuthAppId.isEmpty() || RegToken.isEmpty() || Validity.isNull()))
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   172
		{
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   173
		TBool Flag = EFalse;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   174
		QT_TRAP_THROWING ( Flag = m_SmfClientPrivate->DeleteAuthDataL(AuthAppId, RegToken, Validity));
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   175
		if (Flag)
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   176
			errorCode = SmfErrNone;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   177
		else
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   178
			errorCode = SmfErrUnAutherised;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   179
		}
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   180
	
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   181
	return errorCode;
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   182
	}
83d6a149c755 Submitting following changes -
cgandhi
parents: 24
diff changeset
   183