securitydialogs/secuidialognotifiersrv/src/untrustedcertquery.cpp
author hgs
Tue, 28 Sep 2010 14:03:54 +0300
changeset 59 881d92421467
permissions -rw-r--r--
201037_03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
59
881d92421467 201037_03
hgs
parents:
diff changeset
     1
/*
881d92421467 201037_03
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
881d92421467 201037_03
hgs
parents:
diff changeset
     3
* All rights reserved.
881d92421467 201037_03
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
881d92421467 201037_03
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
881d92421467 201037_03
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
881d92421467 201037_03
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
881d92421467 201037_03
hgs
parents:
diff changeset
     8
*
881d92421467 201037_03
hgs
parents:
diff changeset
     9
* Initial Contributors:
881d92421467 201037_03
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
881d92421467 201037_03
hgs
parents:
diff changeset
    11
*
881d92421467 201037_03
hgs
parents:
diff changeset
    12
* Contributors:
881d92421467 201037_03
hgs
parents:
diff changeset
    13
*
881d92421467 201037_03
hgs
parents:
diff changeset
    14
* Description:  Displays untrusted certificate dialog
881d92421467 201037_03
hgs
parents:
diff changeset
    15
*
881d92421467 201037_03
hgs
parents:
diff changeset
    16
*/
881d92421467 201037_03
hgs
parents:
diff changeset
    17
881d92421467 201037_03
hgs
parents:
diff changeset
    18
#include "untrustedcertquery.h"             // CUntrustedCertQuery
881d92421467 201037_03
hgs
parents:
diff changeset
    19
#include <hb/hbcore/hbsymbianvariant.h>     // CHbSymbianVariantMap
881d92421467 201037_03
hgs
parents:
diff changeset
    20
#include "secuidialogstrace.h"           // TRACE macro
881d92421467 201037_03
hgs
parents:
diff changeset
    21
881d92421467 201037_03
hgs
parents:
diff changeset
    22
// Note that the dialog type string, the parameters name strings, and the return code
881d92421467 201037_03
hgs
parents:
diff changeset
    23
// name string and values must match to those defined in Qt-side untrusted certificate
881d92421467 201037_03
hgs
parents:
diff changeset
    24
// dialog (in untrustedcertificatedefinitions.h file).
881d92421467 201037_03
hgs
parents:
diff changeset
    25
881d92421467 201037_03
hgs
parents:
diff changeset
    26
// Device dialog type for untrusted certificate dialog
881d92421467 201037_03
hgs
parents:
diff changeset
    27
_LIT( KUntrustedCertificateDialog, "com.nokia.untrustedcert/1.0" );
881d92421467 201037_03
hgs
parents:
diff changeset
    28
881d92421467 201037_03
hgs
parents:
diff changeset
    29
// Variant map parameter names for untrusted certificate dialog
881d92421467 201037_03
hgs
parents:
diff changeset
    30
_LIT( KUntrustedCertEncodedCertificate, "cert" );   // bytearray, mandatory
881d92421467 201037_03
hgs
parents:
diff changeset
    31
_LIT( KUntrustedCertServerName, "host" );           // string, mandatory
881d92421467 201037_03
hgs
parents:
diff changeset
    32
_LIT( KUntrustedCertValidationError, "err" );       // int (TValidationError), mandatory
881d92421467 201037_03
hgs
parents:
diff changeset
    33
_LIT( KUntrustedCertTrustedSiteStoreFail, "tss" );  // any, prevents permanent acceptance
881d92421467 201037_03
hgs
parents:
diff changeset
    34
881d92421467 201037_03
hgs
parents:
diff changeset
    35
// Dialog return code name and values
881d92421467 201037_03
hgs
parents:
diff changeset
    36
_LIT( KUntrustedCertDialogResult, "result" );       // int
881d92421467 201037_03
hgs
parents:
diff changeset
    37
const TInt KUntrustedCertDialogRejected = 0;
881d92421467 201037_03
hgs
parents:
diff changeset
    38
const TInt KUntrustedCertDialogAccepted = 1;
881d92421467 201037_03
hgs
parents:
diff changeset
    39
const TInt KUntrustedCertDialogAcceptedPermanently = 2;
881d92421467 201037_03
hgs
parents:
diff changeset
    40
881d92421467 201037_03
hgs
parents:
diff changeset
    41
881d92421467 201037_03
hgs
parents:
diff changeset
    42
// ======== MEMBER FUNCTIONS ========
881d92421467 201037_03
hgs
parents:
diff changeset
    43
881d92421467 201037_03
hgs
parents:
diff changeset
    44
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    45
// CUntrustedCertQuery::NewL()
881d92421467 201037_03
hgs
parents:
diff changeset
    46
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    47
//
881d92421467 201037_03
hgs
parents:
diff changeset
    48
CUntrustedCertQuery* CUntrustedCertQuery::NewL(
881d92421467 201037_03
hgs
parents:
diff changeset
    49
        TValidationError aValidationError, const TDesC8& aCertificate,
881d92421467 201037_03
hgs
parents:
diff changeset
    50
        const TDesC& aServerName, TBool aCanHandlePermanentAccept )
881d92421467 201037_03
hgs
parents:
diff changeset
    51
    {
881d92421467 201037_03
hgs
parents:
diff changeset
    52
    TRACE( "CUntrustedCertQuery::NewL" );
881d92421467 201037_03
hgs
parents:
diff changeset
    53
    CUntrustedCertQuery* self = new ( ELeave ) CUntrustedCertQuery(
881d92421467 201037_03
hgs
parents:
diff changeset
    54
            aValidationError, aCertificate, aServerName,
881d92421467 201037_03
hgs
parents:
diff changeset
    55
            aCanHandlePermanentAccept );
881d92421467 201037_03
hgs
parents:
diff changeset
    56
    CleanupStack::PushL( self );
881d92421467 201037_03
hgs
parents:
diff changeset
    57
    self->ConstructL();
881d92421467 201037_03
hgs
parents:
diff changeset
    58
    CleanupStack::Pop( self );
881d92421467 201037_03
hgs
parents:
diff changeset
    59
    return self;
881d92421467 201037_03
hgs
parents:
diff changeset
    60
    }
881d92421467 201037_03
hgs
parents:
diff changeset
    61
881d92421467 201037_03
hgs
parents:
diff changeset
    62
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    63
// CUntrustedCertQuery::~CUntrustedCertQuery()
881d92421467 201037_03
hgs
parents:
diff changeset
    64
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    65
//
881d92421467 201037_03
hgs
parents:
diff changeset
    66
CUntrustedCertQuery::~CUntrustedCertQuery()
881d92421467 201037_03
hgs
parents:
diff changeset
    67
    {
881d92421467 201037_03
hgs
parents:
diff changeset
    68
    TRACE( "CUntrustedCertQuery::~CUntrustedCertQuery, begin" );
881d92421467 201037_03
hgs
parents:
diff changeset
    69
    Cancel();
881d92421467 201037_03
hgs
parents:
diff changeset
    70
    delete iWait;
881d92421467 201037_03
hgs
parents:
diff changeset
    71
    iWait = NULL;
881d92421467 201037_03
hgs
parents:
diff changeset
    72
    delete iDeviceDialog;
881d92421467 201037_03
hgs
parents:
diff changeset
    73
    iDeviceDialog = NULL;
881d92421467 201037_03
hgs
parents:
diff changeset
    74
    delete iVariantMap;
881d92421467 201037_03
hgs
parents:
diff changeset
    75
    iVariantMap = NULL;
881d92421467 201037_03
hgs
parents:
diff changeset
    76
    TRACE( "CUntrustedCertQuery::~CUntrustedCertQuery, end" );
881d92421467 201037_03
hgs
parents:
diff changeset
    77
    }
881d92421467 201037_03
hgs
parents:
diff changeset
    78
881d92421467 201037_03
hgs
parents:
diff changeset
    79
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    80
// CUntrustedCertQuery::ShowQueryAndWaitForResponseL()
881d92421467 201037_03
hgs
parents:
diff changeset
    81
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    82
//
881d92421467 201037_03
hgs
parents:
diff changeset
    83
void CUntrustedCertQuery::ShowQueryAndWaitForResponseL( TResponse& aResponse )
881d92421467 201037_03
hgs
parents:
diff changeset
    84
    {
881d92421467 201037_03
hgs
parents:
diff changeset
    85
    TRACE( "CUntrustedCertQuery::ShowQueryAndWaitForResponseL, begin" );
881d92421467 201037_03
hgs
parents:
diff changeset
    86
    if( !iDeviceDialog )
881d92421467 201037_03
hgs
parents:
diff changeset
    87
        {
881d92421467 201037_03
hgs
parents:
diff changeset
    88
        iDeviceDialog = CHbDeviceDialogSymbian::NewL();
881d92421467 201037_03
hgs
parents:
diff changeset
    89
        }
881d92421467 201037_03
hgs
parents:
diff changeset
    90
    if( !iVariantMap )
881d92421467 201037_03
hgs
parents:
diff changeset
    91
        {
881d92421467 201037_03
hgs
parents:
diff changeset
    92
        iVariantMap = CHbSymbianVariantMap::NewL();
881d92421467 201037_03
hgs
parents:
diff changeset
    93
        }
881d92421467 201037_03
hgs
parents:
diff changeset
    94
881d92421467 201037_03
hgs
parents:
diff changeset
    95
    CHbSymbianVariant *variant = NULL;
881d92421467 201037_03
hgs
parents:
diff changeset
    96
    variant = CHbSymbianVariant::NewL( &iCertificate, CHbSymbianVariant::EBinary );
881d92421467 201037_03
hgs
parents:
diff changeset
    97
    User::LeaveIfError( iVariantMap->Add( KUntrustedCertEncodedCertificate, variant ) );
881d92421467 201037_03
hgs
parents:
diff changeset
    98
    variant = CHbSymbianVariant::NewL( &iValidationError, CHbSymbianVariant::EInt );
881d92421467 201037_03
hgs
parents:
diff changeset
    99
    User::LeaveIfError( iVariantMap->Add( KUntrustedCertValidationError, variant ) );
881d92421467 201037_03
hgs
parents:
diff changeset
   100
    variant = CHbSymbianVariant::NewL( &iServerName, CHbSymbianVariant::EDes );
881d92421467 201037_03
hgs
parents:
diff changeset
   101
    User::LeaveIfError( iVariantMap->Add( KUntrustedCertServerName, variant ) );
881d92421467 201037_03
hgs
parents:
diff changeset
   102
    if( !iCanHandlePermanentAccept )
881d92421467 201037_03
hgs
parents:
diff changeset
   103
        {
881d92421467 201037_03
hgs
parents:
diff changeset
   104
        variant = CHbSymbianVariant::NewL( &iCanHandlePermanentAccept, CHbSymbianVariant::EBool );
881d92421467 201037_03
hgs
parents:
diff changeset
   105
        User::LeaveIfError( iVariantMap->Add( KUntrustedCertTrustedSiteStoreFail, variant ) );
881d92421467 201037_03
hgs
parents:
diff changeset
   106
        }
881d92421467 201037_03
hgs
parents:
diff changeset
   107
881d92421467 201037_03
hgs
parents:
diff changeset
   108
    User::LeaveIfError( iDeviceDialog->Show( KUntrustedCertificateDialog, *iVariantMap, this ) );
881d92421467 201037_03
hgs
parents:
diff changeset
   109
    iStatus = KRequestPending;
881d92421467 201037_03
hgs
parents:
diff changeset
   110
    SetActive();
881d92421467 201037_03
hgs
parents:
diff changeset
   111
881d92421467 201037_03
hgs
parents:
diff changeset
   112
    TRACE( "CUntrustedCertQuery::ShowQueryAndWaitForResponseL, iWait start" );
881d92421467 201037_03
hgs
parents:
diff changeset
   113
    iWait->Start();
881d92421467 201037_03
hgs
parents:
diff changeset
   114
    TRACE( "CUntrustedCertQuery::ShowQueryAndWaitForResponseL, iWaitCompletionCode=%d",
881d92421467 201037_03
hgs
parents:
diff changeset
   115
            iWaitCompletionCode );
881d92421467 201037_03
hgs
parents:
diff changeset
   116
    User::LeaveIfError( iWaitCompletionCode );
881d92421467 201037_03
hgs
parents:
diff changeset
   117
    TRACE( "CUntrustedCertQuery::ShowQueryAndWaitForResponseL, iResponse=%d", iResponse );
881d92421467 201037_03
hgs
parents:
diff changeset
   118
    aResponse = iResponse;
881d92421467 201037_03
hgs
parents:
diff changeset
   119
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   120
881d92421467 201037_03
hgs
parents:
diff changeset
   121
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   122
// CUntrustedCertQuery::DoCancel()
881d92421467 201037_03
hgs
parents:
diff changeset
   123
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   124
//
881d92421467 201037_03
hgs
parents:
diff changeset
   125
void CUntrustedCertQuery::DoCancel()
881d92421467 201037_03
hgs
parents:
diff changeset
   126
    {
881d92421467 201037_03
hgs
parents:
diff changeset
   127
    TRACE( "CUntrustedCertQuery::DoCancel, begin" );
881d92421467 201037_03
hgs
parents:
diff changeset
   128
    if( iDeviceDialog )
881d92421467 201037_03
hgs
parents:
diff changeset
   129
        {
881d92421467 201037_03
hgs
parents:
diff changeset
   130
        TRACE( "CUntrustedCertQuery::DoCancel, cancelling device dialog" );
881d92421467 201037_03
hgs
parents:
diff changeset
   131
        iDeviceDialog->Cancel();
881d92421467 201037_03
hgs
parents:
diff changeset
   132
        }
881d92421467 201037_03
hgs
parents:
diff changeset
   133
881d92421467 201037_03
hgs
parents:
diff changeset
   134
    // Have to complete the request here, because cancelled device dialog does not
881d92421467 201037_03
hgs
parents:
diff changeset
   135
    // call DeviceDialogClosed() that normally completes it. The request needs to
881d92421467 201037_03
hgs
parents:
diff changeset
   136
    // be completed since CActive::Cancel() waits until the request is completed.
881d92421467 201037_03
hgs
parents:
diff changeset
   137
    TRACE( "CUntrustedCertQuery::DoCancel, completing self with KErrCancel" );
881d92421467 201037_03
hgs
parents:
diff changeset
   138
    TRequestStatus* status( &iStatus );
881d92421467 201037_03
hgs
parents:
diff changeset
   139
    User::RequestComplete( status, KErrCancel );
881d92421467 201037_03
hgs
parents:
diff changeset
   140
881d92421467 201037_03
hgs
parents:
diff changeset
   141
    // Normally the above request complete would trigger running RunL(). Now RunL()
881d92421467 201037_03
hgs
parents:
diff changeset
   142
    // is not run since the active object is already cancelled. Hence, have to stop
881d92421467 201037_03
hgs
parents:
diff changeset
   143
    // the waiting here so that iWait->Start() returns.
881d92421467 201037_03
hgs
parents:
diff changeset
   144
    iWaitCompletionCode = KErrCancel;
881d92421467 201037_03
hgs
parents:
diff changeset
   145
    if( iWait && iWait->IsStarted() )
881d92421467 201037_03
hgs
parents:
diff changeset
   146
        {
881d92421467 201037_03
hgs
parents:
diff changeset
   147
        TRACE( "CUntrustedCertQuery::DoCancel, stopping iWait" );
881d92421467 201037_03
hgs
parents:
diff changeset
   148
        iWait->AsyncStop();
881d92421467 201037_03
hgs
parents:
diff changeset
   149
        }
881d92421467 201037_03
hgs
parents:
diff changeset
   150
    TRACE( "CUntrustedCertQuery::DoCancel, end" );
881d92421467 201037_03
hgs
parents:
diff changeset
   151
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   152
881d92421467 201037_03
hgs
parents:
diff changeset
   153
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   154
// CUntrustedCertQuery::RunL()
881d92421467 201037_03
hgs
parents:
diff changeset
   155
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   156
//
881d92421467 201037_03
hgs
parents:
diff changeset
   157
void CUntrustedCertQuery::RunL()
881d92421467 201037_03
hgs
parents:
diff changeset
   158
    {
881d92421467 201037_03
hgs
parents:
diff changeset
   159
    TRACE( "CUntrustedCertQuery::RunL, iStatus.Int()=%d", iStatus.Int() );
881d92421467 201037_03
hgs
parents:
diff changeset
   160
    iWaitCompletionCode = iStatus.Int();
881d92421467 201037_03
hgs
parents:
diff changeset
   161
    if( iWait && iWait->IsStarted() )
881d92421467 201037_03
hgs
parents:
diff changeset
   162
        {
881d92421467 201037_03
hgs
parents:
diff changeset
   163
        TRACE( "CUntrustedCertQuery::RunL, stopping iWait" );
881d92421467 201037_03
hgs
parents:
diff changeset
   164
        iWait->AsyncStop();
881d92421467 201037_03
hgs
parents:
diff changeset
   165
        }
881d92421467 201037_03
hgs
parents:
diff changeset
   166
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   167
881d92421467 201037_03
hgs
parents:
diff changeset
   168
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   169
// CUntrustedCertQuery::DataReceived()
881d92421467 201037_03
hgs
parents:
diff changeset
   170
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   171
//
881d92421467 201037_03
hgs
parents:
diff changeset
   172
void CUntrustedCertQuery::DataReceived( CHbSymbianVariantMap& aData )
881d92421467 201037_03
hgs
parents:
diff changeset
   173
    {
881d92421467 201037_03
hgs
parents:
diff changeset
   174
    TRACE( "CUntrustedCertQuery::DataReceived" );
881d92421467 201037_03
hgs
parents:
diff changeset
   175
    const CHbSymbianVariant* variant = aData.Get( KUntrustedCertDialogResult );
881d92421467 201037_03
hgs
parents:
diff changeset
   176
    if( variant )
881d92421467 201037_03
hgs
parents:
diff changeset
   177
        {
881d92421467 201037_03
hgs
parents:
diff changeset
   178
        TInt* value = variant->Value<TInt>();
881d92421467 201037_03
hgs
parents:
diff changeset
   179
        if( value )
881d92421467 201037_03
hgs
parents:
diff changeset
   180
            {
881d92421467 201037_03
hgs
parents:
diff changeset
   181
            switch( *value )
881d92421467 201037_03
hgs
parents:
diff changeset
   182
                {
881d92421467 201037_03
hgs
parents:
diff changeset
   183
                case KUntrustedCertDialogRejected:
881d92421467 201037_03
hgs
parents:
diff changeset
   184
                    TRACE( "CUntrustedCertQuery::DataReceived, rejected" );
881d92421467 201037_03
hgs
parents:
diff changeset
   185
                    iResponse = EQueryRejected;
881d92421467 201037_03
hgs
parents:
diff changeset
   186
                    break;
881d92421467 201037_03
hgs
parents:
diff changeset
   187
                case KUntrustedCertDialogAccepted:
881d92421467 201037_03
hgs
parents:
diff changeset
   188
                    TRACE( "CUntrustedCertQuery::DataReceived, accepted" );
881d92421467 201037_03
hgs
parents:
diff changeset
   189
                    iResponse = EQueryAccepted;
881d92421467 201037_03
hgs
parents:
diff changeset
   190
                    break;
881d92421467 201037_03
hgs
parents:
diff changeset
   191
                case KUntrustedCertDialogAcceptedPermanently:
881d92421467 201037_03
hgs
parents:
diff changeset
   192
                    TRACE( "CUntrustedCertQuery::DataReceived, accepted permanently" );
881d92421467 201037_03
hgs
parents:
diff changeset
   193
                    iResponse = EQueryAcceptedPermanently;
881d92421467 201037_03
hgs
parents:
diff changeset
   194
                    break;
881d92421467 201037_03
hgs
parents:
diff changeset
   195
                default:
881d92421467 201037_03
hgs
parents:
diff changeset
   196
                    __ASSERT_DEBUG( EFalse, User::Invariant() );
881d92421467 201037_03
hgs
parents:
diff changeset
   197
                    break;
881d92421467 201037_03
hgs
parents:
diff changeset
   198
                }
881d92421467 201037_03
hgs
parents:
diff changeset
   199
            }
881d92421467 201037_03
hgs
parents:
diff changeset
   200
        else
881d92421467 201037_03
hgs
parents:
diff changeset
   201
            {
881d92421467 201037_03
hgs
parents:
diff changeset
   202
            __ASSERT_DEBUG( EFalse, User::Invariant() );
881d92421467 201037_03
hgs
parents:
diff changeset
   203
            }
881d92421467 201037_03
hgs
parents:
diff changeset
   204
        }
881d92421467 201037_03
hgs
parents:
diff changeset
   205
    else
881d92421467 201037_03
hgs
parents:
diff changeset
   206
        {
881d92421467 201037_03
hgs
parents:
diff changeset
   207
        __ASSERT_DEBUG( EFalse, User::Invariant() );
881d92421467 201037_03
hgs
parents:
diff changeset
   208
        }
881d92421467 201037_03
hgs
parents:
diff changeset
   209
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   210
881d92421467 201037_03
hgs
parents:
diff changeset
   211
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   212
// CUntrustedCertQuery::DeviceDialogClosed()
881d92421467 201037_03
hgs
parents:
diff changeset
   213
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   214
//
881d92421467 201037_03
hgs
parents:
diff changeset
   215
void CUntrustedCertQuery::DeviceDialogClosed( TInt aCompletionCode )
881d92421467 201037_03
hgs
parents:
diff changeset
   216
    {
881d92421467 201037_03
hgs
parents:
diff changeset
   217
    TRACE( "CUntrustedCertQuery::DeviceDialogClosed, aCompletionCode=%d", aCompletionCode );
881d92421467 201037_03
hgs
parents:
diff changeset
   218
    if( IsActive() )
881d92421467 201037_03
hgs
parents:
diff changeset
   219
        {
881d92421467 201037_03
hgs
parents:
diff changeset
   220
        TRACE( "CUntrustedCertQuery::DeviceDialogClosed, request complete" );
881d92421467 201037_03
hgs
parents:
diff changeset
   221
        TRequestStatus* status( &iStatus );
881d92421467 201037_03
hgs
parents:
diff changeset
   222
        User::RequestComplete( status, aCompletionCode );
881d92421467 201037_03
hgs
parents:
diff changeset
   223
        }
881d92421467 201037_03
hgs
parents:
diff changeset
   224
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   225
881d92421467 201037_03
hgs
parents:
diff changeset
   226
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   227
// CUntrustedCertQuery::CUntrustedCertQuery()
881d92421467 201037_03
hgs
parents:
diff changeset
   228
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   229
//
881d92421467 201037_03
hgs
parents:
diff changeset
   230
CUntrustedCertQuery::CUntrustedCertQuery(
881d92421467 201037_03
hgs
parents:
diff changeset
   231
        TValidationError aValidationError, const TDesC8& aCertificate,
881d92421467 201037_03
hgs
parents:
diff changeset
   232
        const TDesC& aServerName, TBool aCanHandlePermanentAccept ) :
881d92421467 201037_03
hgs
parents:
diff changeset
   233
        CActive( CActive::EPriorityStandard ), iValidationError( aValidationError ),
881d92421467 201037_03
hgs
parents:
diff changeset
   234
        iCertificate( aCertificate ), iServerName( aServerName ),
881d92421467 201037_03
hgs
parents:
diff changeset
   235
        iCanHandlePermanentAccept( aCanHandlePermanentAccept ),
881d92421467 201037_03
hgs
parents:
diff changeset
   236
        iResponse( EQueryRejected )
881d92421467 201037_03
hgs
parents:
diff changeset
   237
    {
881d92421467 201037_03
hgs
parents:
diff changeset
   238
    CActiveScheduler::Add( this );
881d92421467 201037_03
hgs
parents:
diff changeset
   239
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   240
881d92421467 201037_03
hgs
parents:
diff changeset
   241
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   242
// CUntrustedCertQuery::ConstructL()
881d92421467 201037_03
hgs
parents:
diff changeset
   243
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   244
//
881d92421467 201037_03
hgs
parents:
diff changeset
   245
void CUntrustedCertQuery::ConstructL()
881d92421467 201037_03
hgs
parents:
diff changeset
   246
    {
881d92421467 201037_03
hgs
parents:
diff changeset
   247
    TRACE( "CUntrustedCertQuery::ConstructL" );
881d92421467 201037_03
hgs
parents:
diff changeset
   248
    iWait = new( ELeave ) CActiveSchedulerWait;
881d92421467 201037_03
hgs
parents:
diff changeset
   249
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   250