pkiutilities/securitydialognotifiersrv/inc/securitydialogoperserverauthfail.h
branchRCL_3
changeset 22 03674e5abf46
parent 21 09b1ac925e3f
child 23 94da73d93b58
equal deleted inserted replaced
21:09b1ac925e3f 22:03674e5abf46
     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:  Server authentication failure operation in security dialog
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef SECURITYDIALOGOPERSERVERAUTHFAIL_H
       
    19 #define SECURITYDIALOGOPERSERVERAUTHFAIL_H
       
    20 
       
    21 #include "securitydialogoperation.h"    // CSecurityDialogOperation
       
    22 #include <securitydefs.h>               // TValidationError
       
    23 #include <ct/rmpointerarray.h>          // RMPointerArray
       
    24 #include <f32file.h>                    // RFs
       
    25 #include <secdlgimpldefs.h>             // TServerAuthenticationFailureDialogResult
       
    26 
       
    27 class MSecurityDialogOperationObserver;
       
    28 class CServerAuthenticationFailureInput;
       
    29 class CUnifiedCertStore;
       
    30 class MCTWritableCertStore;
       
    31 class CCertAttributeFilter;
       
    32 class CCTCertInfo;
       
    33 class CUntrustedCertQuery;
       
    34 
       
    35 
       
    36 /**
       
    37  * CServerAuthFailOperation is a CSecurityDialogOperation that handles
       
    38  * the EServerAuthenticationFailure operation.
       
    39  */
       
    40 NONSHARABLE_CLASS( CServerAuthFailOperation ) : public CSecurityDialogOperation
       
    41     {
       
    42     public:     // constructors and destructor
       
    43         static CServerAuthFailOperation* NewL( MSecurityDialogOperationObserver& aObserver,
       
    44                 const RMessage2& aMessage, TInt aReplySlot );
       
    45         ~CServerAuthFailOperation();
       
    46 
       
    47     public:     // from CSecurityDialogOperation
       
    48         void StartL( const TDesC8& aBuffer );
       
    49         void CancelOperation();
       
    50 
       
    51     protected:  // from CActive (via CSecurityDialogOperation)
       
    52         void RunL();
       
    53         void DoCancel();
       
    54 
       
    55     private:    // new functions
       
    56         CServerAuthFailOperation( MSecurityDialogOperationObserver& aObserver,
       
    57                 const RMessage2& aMessage, TInt aReplySlot );
       
    58         void InitializeUnifiedCertStoreL();
       
    59         void ProcessServerAuthorizationFailureL();
       
    60         void OpenTrustedSiteCertificateStoreL();
       
    61         TBool IsAlreadyTrustedSiteL();
       
    62         void StartFetchingTrustedSiteCertsL();
       
    63         void ShowUntrustedCertificateDialogL();
       
    64         void SaveServerCertToTrustedSiteCertStoreL();
       
    65         void SaveServerNameToTrustedSitesStoreL();
       
    66         void ReturnResultL( TServerAuthenticationFailureDialogResult aResult );
       
    67         void RetrieveFirstTrustedSiteCertL();
       
    68         void RetrieveNextTrustedSiteCertL();
       
    69         TBool IsRetrievedCertSameAsServerCertL();
       
    70 
       
    71     private:    // data
       
    72         CServerAuthenticationFailureInput* iInput;
       
    73 
       
    74         TValidationError iAuthFailReason;
       
    75         TPtrC8 iEncodedServerCert;
       
    76         HBufC8* iServerCertFingerprint;
       
    77         HBufC* iServerName;
       
    78         HBufC* iCertLabel;
       
    79 
       
    80         CUntrustedCertQuery* iUntrustedCertQuery;
       
    81 
       
    82         RFs iFs;
       
    83         CUnifiedCertStore* iCertStore;
       
    84         MCTWritableCertStore* iTrustedSiteCertStore;
       
    85         CCertAttributeFilter* iCertAttributeFilter;
       
    86         RMPointerArray<CCTCertInfo> iCertInfos;
       
    87         TInt iRetrieveCertIndex;
       
    88         HBufC8* iRetrievedCertBuffer;
       
    89 
       
    90         enum {
       
    91             EInitialiseCertStore,
       
    92             EListTrustedSiteCerts,
       
    93             ERetrieveTrustedSiteCert,
       
    94             ESavingServerCert
       
    95         } iMode;
       
    96     };
       
    97 
       
    98 #endif  // SECURITYDIALOGOPERSERVERAUTHFAIL_H
       
    99