cpsecplugins/cpadvancedsecplugin/src/cpcerttrustview.cpp
changeset 37 7bad16cccaca
parent 19 098e361762d2
child 35 f1030a78d563
equal deleted inserted replaced
26:aad866c37519 37:7bad16cccaca
    33 #include <hbdataformmodelitem.h>
    33 #include <hbdataformmodelitem.h>
    34 #include <hblistwidgetitem.h>
    34 #include <hblistwidgetitem.h>
    35 #include <hblistwidget.h>
    35 #include <hblistwidget.h>
    36 
    36 
    37 #include <memory>
    37 #include <memory>
    38 
    38 #include <../../inc/cpsecplugins.h>
    39 #include "cpcerttrustview.h"
    39 #include "cpcerttrustview.h"
    40 #include "cpcertdatacontainer.h"
    40 #include "cpcertdatacontainer.h"
    41 #include "cpcertmanuisyncwrapper.h"
    41 #include "cpcertmanuisyncwrapper.h"
    42 #include "cpuitrustids.h"
    42 #include "cpuitrustids.h"
    43 
    43 
    69     }
    69     }
    70 
    70 
    71 
    71 
    72 void CpCertTrustView::viewTrustSettings()
    72 void CpCertTrustView::viewTrustSettings()
    73 	{
    73 	{
       
    74 	RDEBUG("0", 0);
    74 	mTrustedClients << " \tWAP connection\t\t";
    75 	mTrustedClients << " \tWAP connection\t\t";
    75 	mTrustedClients << " \tMail and Image conn.\t\t";
    76 	mTrustedClients << " \tMail and Image conn.\t\t";
    76 	mTrustedClients << " \tNative installing\t\t";
    77 	mTrustedClients << " \tNative installing\t\t";
    77 	mTrustedClients << " \tJava installing\t\t";
    78 	mTrustedClients << " \tJava installing\t\t";
    78 	mTrustedClients << " \tOCSP validation\t\t";
    79 	mTrustedClients << " \tOCSP validation\t\t";
   109 // TCertificateAppInfo's Name() function.
   110 // TCertificateAppInfo's Name() function.
   110 // ---------------------------------------------------------------------------
   111 // ---------------------------------------------------------------------------
   111 //
   112 //
   112 void CpCertTrustView::updateListBoxL()
   113 void CpCertTrustView::updateListBoxL()
   113     {
   114     {
       
   115     RDEBUG("0", 0);
   114     mClientUids.Reset();
   116     mClientUids.Reset();
   115 
   117 
   116     TInt clientCount = 0;
   118     TInt clientCount = 0;
   117 
   119 
   118     // Use certificate index from previous view
   120     // Use certificate index from previous view
   194 	std::auto_ptr<HbListWidgetItem> certLabel(q_check_ptr(new HbListWidgetItem()));
   196 	std::auto_ptr<HbListWidgetItem> certLabel(q_check_ptr(new HbListWidgetItem()));
   195 	const TDesC& label = entry->Label();
   197 	const TDesC& label = entry->Label();
   196 	certLabel->setText(QString( (QChar*)label.Ptr(),label.Length() ) );
   198 	certLabel->setText(QString( (QChar*)label.Ptr(),label.Length() ) );
   197 	mCertLabelList->addItem(certLabel.get());
   199 	mCertLabelList->addItem(certLabel.get());
   198 	certLabel.release();
   200 	certLabel.release();
   199 	
   201 	RDEBUG("0", 0);
   200 	int count = mTrustedClients.size();
   202 	int count = mTrustedClients.size();
   201 	for( int index = 0 ;index < count; ++index)
   203 	for( int index = 0 ;index < count; ++index)
   202 		{
   204 		{
   203 		std::auto_ptr<HbDataFormModelItem> item (q_check_ptr(new HbDataFormModelItem( 
   205 		std::auto_ptr<HbDataFormModelItem> item (q_check_ptr(new HbDataFormModelItem( 
   204 										HbDataFormModelItem::ToggleValueItem,
   206 										HbDataFormModelItem::ToggleValueItem,
   224 	form.release();
   226 	form.release();
   225     }
   227     }
   226 
   228 
   227 void CpCertTrustView::saveTrustSettings()
   229 void CpCertTrustView::saveTrustSettings()
   228 	{
   230 	{
       
   231 	RDEBUG("0", 0);
   229 	CCTCertInfo& entry = *( mCertDataContainer.iCALabelEntries[ mCertificateIndex ]->iCAEntry );
   232 	CCTCertInfo& entry = *( mCertDataContainer.iCALabelEntries[ mCertificateIndex ]->iCAEntry );
   230 	if ( entry.IsDeletable() )
   233 	if ( entry.IsDeletable() )
   231 		{
   234 		{
   232 		TInt itemCount = mFormModel->rowCount();
   235 		TInt itemCount = mFormModel->rowCount();
   233 		RArray<TUid> newUids;
   236 		RArray<TUid> newUids;
   247 		}
   250 		}
   248 	}
   251 	}
   249 
   252 
   250 TUid CpCertTrustView::trusterId(const QString& clientDescription) const
   253 TUid CpCertTrustView::trusterId(const QString& clientDescription) const
   251 	{
   254 	{
       
   255 	RDEBUG("0", 0);
   252 	TUid retValue = TUid::Uid(0);
   256 	TUid retValue = TUid::Uid(0);
   253 	if( clientDescription ==  " \tWAP connection\t\t" )
   257 	if( clientDescription ==  " \tWAP connection\t\t" )
   254 		retValue = KCertManUIViewTrustWapConnectionId;
   258 		retValue = KCertManUIViewTrustWapConnectionId;
   255 	else if( clientDescription ==  " \tMail and Image conn.\t\t" )
   259 	else if( clientDescription ==  " \tMail and Image conn.\t\t" )
   256 		retValue = KCertManUIViewTrustMailAndImageConnId;
   260 		retValue = KCertManUIViewTrustMailAndImageConnId;
   271 // CpCertTrustView::trustIdIndex( TUid trustUid )
   275 // CpCertTrustView::trustIdIndex( TUid trustUid )
   272 // ---------------------------------------------------------------------------
   276 // ---------------------------------------------------------------------------
   273 //
   277 //
   274 TInt CpCertTrustView::trustIdIndex( TUid trustUid ) const
   278 TInt CpCertTrustView::trustIdIndex( TUid trustUid ) const
   275     {
   279     {
       
   280     RDEBUG("0", 0);
   276     TInt resIndex = KErrNotFound;
   281     TInt resIndex = KErrNotFound;
   277     
   282     
   278     if ( trustUid == KCertManUIViewTrustApplicationControllerId )
   283     if ( trustUid == KCertManUIViewTrustApplicationControllerId )
   279         {
   284         {
   280         resIndex = KTrustSettingsResourceIndexAppCtrl;
   285         resIndex = KTrustSettingsResourceIndexAppCtrl;
   320 // ---------------------------------------------------------------------------
   325 // ---------------------------------------------------------------------------
   321 //
   326 //
   322 TBool CpCertTrustView::checkCertificateClientTrustL(
   327 TBool CpCertTrustView::checkCertificateClientTrustL(
   323     const TUid clientUid, const CCTCertInfo& entry ) const
   328     const TUid clientUid, const CCTCertInfo& entry ) const
   324     {
   329     {
       
   330     RDEBUG("0", 0);
   325     TBool trustSettingTrusted = EFalse;
   331     TBool trustSettingTrusted = EFalse;
   326     TCertificateFormat format = entry.CertificateFormat();
   332     TCertificateFormat format = entry.CertificateFormat();
   327 
   333 
   328     if ( format == EX509Certificate )
   334     if ( format == EX509Certificate )
   329         {
   335         {