pkiutilities/securitydialognotifiersrv/inc/securitydialogoperserverauthfail.h
author hgs
Fri, 20 Aug 2010 11:27:50 +0300
changeset 48 6ed68423b759
child 63 989397f9511c
permissions -rw-r--r--
201033_01
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48
6ed68423b759 201033_01
hgs
parents:
diff changeset
     1
/*
6ed68423b759 201033_01
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
6ed68423b759 201033_01
hgs
parents:
diff changeset
     3
* All rights reserved.
6ed68423b759 201033_01
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
6ed68423b759 201033_01
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
6ed68423b759 201033_01
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
6ed68423b759 201033_01
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
6ed68423b759 201033_01
hgs
parents:
diff changeset
     8
*
6ed68423b759 201033_01
hgs
parents:
diff changeset
     9
* Initial Contributors:
6ed68423b759 201033_01
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
6ed68423b759 201033_01
hgs
parents:
diff changeset
    11
*
6ed68423b759 201033_01
hgs
parents:
diff changeset
    12
* Contributors:
6ed68423b759 201033_01
hgs
parents:
diff changeset
    13
*
6ed68423b759 201033_01
hgs
parents:
diff changeset
    14
* Description:  Server authentication failure operation in security dialog
6ed68423b759 201033_01
hgs
parents:
diff changeset
    15
*
6ed68423b759 201033_01
hgs
parents:
diff changeset
    16
*/
6ed68423b759 201033_01
hgs
parents:
diff changeset
    17
6ed68423b759 201033_01
hgs
parents:
diff changeset
    18
#ifndef SECURITYDIALOGOPERSERVERAUTHFAIL_H
6ed68423b759 201033_01
hgs
parents:
diff changeset
    19
#define SECURITYDIALOGOPERSERVERAUTHFAIL_H
6ed68423b759 201033_01
hgs
parents:
diff changeset
    20
6ed68423b759 201033_01
hgs
parents:
diff changeset
    21
#include "securitydialogoperation.h"    // CSecurityDialogOperation
6ed68423b759 201033_01
hgs
parents:
diff changeset
    22
#include <securitydefs.h>               // TValidationError
6ed68423b759 201033_01
hgs
parents:
diff changeset
    23
#include <ct/rmpointerarray.h>          // RMPointerArray
6ed68423b759 201033_01
hgs
parents:
diff changeset
    24
#include <f32file.h>                    // RFs
6ed68423b759 201033_01
hgs
parents:
diff changeset
    25
#include <secdlgimpldefs.h>             // TServerAuthenticationFailureDialogResult
6ed68423b759 201033_01
hgs
parents:
diff changeset
    26
6ed68423b759 201033_01
hgs
parents:
diff changeset
    27
class MSecurityDialogOperationObserver;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    28
class CServerAuthenticationFailureInput;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    29
class CUnifiedCertStore;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    30
class MCTWritableCertStore;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    31
class CCertAttributeFilter;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    32
class CCTCertInfo;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    33
class CUntrustedCertQuery;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    34
6ed68423b759 201033_01
hgs
parents:
diff changeset
    35
6ed68423b759 201033_01
hgs
parents:
diff changeset
    36
/**
6ed68423b759 201033_01
hgs
parents:
diff changeset
    37
 * CServerAuthFailOperation is a CSecurityDialogOperation that handles
6ed68423b759 201033_01
hgs
parents:
diff changeset
    38
 * the EServerAuthenticationFailure operation.
6ed68423b759 201033_01
hgs
parents:
diff changeset
    39
 */
6ed68423b759 201033_01
hgs
parents:
diff changeset
    40
NONSHARABLE_CLASS( CServerAuthFailOperation ) : public CSecurityDialogOperation
6ed68423b759 201033_01
hgs
parents:
diff changeset
    41
    {
6ed68423b759 201033_01
hgs
parents:
diff changeset
    42
    public:     // constructors and destructor
6ed68423b759 201033_01
hgs
parents:
diff changeset
    43
        static CServerAuthFailOperation* NewL( MSecurityDialogOperationObserver& aObserver,
6ed68423b759 201033_01
hgs
parents:
diff changeset
    44
                const RMessage2& aMessage, TInt aReplySlot );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    45
        ~CServerAuthFailOperation();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    46
6ed68423b759 201033_01
hgs
parents:
diff changeset
    47
    public:     // from CSecurityDialogOperation
6ed68423b759 201033_01
hgs
parents:
diff changeset
    48
        void StartL( const TDesC8& aBuffer );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    49
        void CancelOperation();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    50
6ed68423b759 201033_01
hgs
parents:
diff changeset
    51
    protected:  // from CActive (via CSecurityDialogOperation)
6ed68423b759 201033_01
hgs
parents:
diff changeset
    52
        void RunL();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    53
        void DoCancel();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    54
6ed68423b759 201033_01
hgs
parents:
diff changeset
    55
    private:    // new functions
6ed68423b759 201033_01
hgs
parents:
diff changeset
    56
        CServerAuthFailOperation( MSecurityDialogOperationObserver& aObserver,
6ed68423b759 201033_01
hgs
parents:
diff changeset
    57
                const RMessage2& aMessage, TInt aReplySlot );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    58
        void InitializeUnifiedCertStoreL();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    59
        void ProcessServerAuthorizationFailureL();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    60
        void OpenTrustedSiteCertificateStoreL();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    61
        TBool IsAlreadyTrustedSiteL();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    62
        void StartFetchingTrustedSiteCertsL();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    63
        void ShowUntrustedCertificateDialogL();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    64
        void SaveServerCertToTrustedSiteCertStoreL();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    65
        void SaveServerNameToTrustedSitesStoreL();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    66
        void ReturnResultL( TServerAuthenticationFailureDialogResult aResult );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    67
        void RetrieveFirstTrustedSiteCertL();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    68
        void RetrieveNextTrustedSiteCertL();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    69
        TBool IsRetrievedCertSameAsServerCertL();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    70
6ed68423b759 201033_01
hgs
parents:
diff changeset
    71
    private:    // data
6ed68423b759 201033_01
hgs
parents:
diff changeset
    72
        CServerAuthenticationFailureInput* iInput;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    73
6ed68423b759 201033_01
hgs
parents:
diff changeset
    74
        TValidationError iAuthFailReason;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    75
        TPtrC8 iEncodedServerCert;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    76
        HBufC8* iServerCertFingerprint;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    77
        HBufC* iServerName;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    78
        HBufC* iCertLabel;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    79
6ed68423b759 201033_01
hgs
parents:
diff changeset
    80
        CUntrustedCertQuery* iUntrustedCertQuery;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    81
6ed68423b759 201033_01
hgs
parents:
diff changeset
    82
        RFs iFs;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    83
        CUnifiedCertStore* iCertStore;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    84
        MCTWritableCertStore* iTrustedSiteCertStore;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    85
        CCertAttributeFilter* iCertAttributeFilter;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    86
        RMPointerArray<CCTCertInfo> iCertInfos;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    87
        TInt iRetrieveCertIndex;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    88
        HBufC8* iRetrievedCertBuffer;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    89
6ed68423b759 201033_01
hgs
parents:
diff changeset
    90
        enum {
6ed68423b759 201033_01
hgs
parents:
diff changeset
    91
            EInitialiseCertStore,
6ed68423b759 201033_01
hgs
parents:
diff changeset
    92
            EListTrustedSiteCerts,
6ed68423b759 201033_01
hgs
parents:
diff changeset
    93
            ERetrieveTrustedSiteCert,
6ed68423b759 201033_01
hgs
parents:
diff changeset
    94
            ESavingServerCert
6ed68423b759 201033_01
hgs
parents:
diff changeset
    95
        } iMode;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    96
    };
6ed68423b759 201033_01
hgs
parents:
diff changeset
    97
6ed68423b759 201033_01
hgs
parents:
diff changeset
    98
#endif  // SECURITYDIALOGOPERSERVERAUTHFAIL_H
6ed68423b759 201033_01
hgs
parents:
diff changeset
    99