securitydialogs/secuidialognotifiersrv/inc/untrustedcertquery.h
changeset 59 881d92421467
equal deleted inserted replaced
53:25dd1e8b2663 59:881d92421467
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Displays untrusted certificate dialog
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_UNTRUSTEDCERTQUERY_H
       
    19 #define C_UNTRUSTEDCERTQUERY_H
       
    20 
       
    21 #include <e32base.h>                            // CActive
       
    22 #include <hb/hbcore/hbdevicedialogsymbian.h>    // MHbDeviceDialogObserver
       
    23 #include <securitydefs.h>                       // TValidationError
       
    24 
       
    25 class CHbDeviceDialogSymbian;
       
    26 class CHbSymbianVariantMap;
       
    27 
       
    28 
       
    29 /**
       
    30 * Displays untrusted certificate query.
       
    31 * Untrusted certificate query dialog is displayed for secure connection
       
    32 * (SSL/TLS) server authentication failure errors. CCTUntrustedCertQuery
       
    33 * class uses UntrustedCertificateDialog device dialog to show the query.
       
    34 */
       
    35 NONSHARABLE_CLASS( CUntrustedCertQuery ) : public CActive, public MHbDeviceDialogObserver
       
    36     {
       
    37     public:     // constructors and destructor
       
    38         static CUntrustedCertQuery* NewL( TValidationError aValidationError,
       
    39                 const TDesC8& aCertificate, const TDesC& aServerName,
       
    40                 TBool aCanHandlePermanentAccept );
       
    41         ~CUntrustedCertQuery();
       
    42 
       
    43     public:     // new functions
       
    44         enum TResponse {
       
    45             EQueryRejected,
       
    46             EQueryAccepted,
       
    47             EQueryAcceptedPermanently
       
    48         };
       
    49         void ShowQueryAndWaitForResponseL( TResponse& aResponse );
       
    50 
       
    51     protected:  // from CActive
       
    52         void DoCancel();
       
    53         void RunL();
       
    54 
       
    55     private:    // from MHbDeviceDialogObserver
       
    56         void DataReceived( CHbSymbianVariantMap& aData );
       
    57         void DeviceDialogClosed( TInt aCompletionCode );
       
    58 
       
    59     private:    // new functions
       
    60         CUntrustedCertQuery( TValidationError aValidationError,
       
    61                 const TDesC8& aCertificate, const TDesC& aServerName,
       
    62                 TBool aCanHandlePermanentAccept );
       
    63         void ConstructL();
       
    64 
       
    65     private:    // data
       
    66         TValidationError iValidationError;
       
    67         const TDesC8& iCertificate;
       
    68         const TDesC& iServerName;
       
    69         TBool iCanHandlePermanentAccept;
       
    70         CActiveSchedulerWait *iWait;
       
    71         TInt iWaitCompletionCode;
       
    72         CHbDeviceDialogSymbian* iDeviceDialog;
       
    73         CHbSymbianVariantMap* iVariantMap;
       
    74         TResponse iResponse;
       
    75     };
       
    76 
       
    77 #endif  // C_UNTRUSTEDCERTQUERY_H
       
    78