xdmprotocols/XcapProtocol/XcapHttpTransport/inc/XcapHttpAuthManager.h
changeset 0 c8caa15ef882
equal deleted inserted replaced
-1:000000000000 0:c8caa15ef882
       
     1 /*
       
     2 * Copyright (c) 2005 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:   CXcapHttpAuthManager
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __XCAPHTTPTAUTHMANAGER__
       
    22 #define __XCAPHTTPTAUTHMANAGER__
       
    23 
       
    24 // INCLUDES
       
    25 #include <XdmCredentials.h>
       
    26 #include <http/mhttpauthenticationcallback.h>
       
    27 #include "XcapHttpConsts.h"
       
    28 
       
    29 //FORWARD DECLARATION  
       
    30 class CMD5;
       
    31 
       
    32 //CLASS DECLARATION
       
    33 class CXcapHttpAuthManager : public CBase
       
    34 
       
    35     {
       
    36     public:  // Constructors and destructor
       
    37         
       
    38         /**
       
    39         * Symbian OS default constructor.
       
    40         */     
       
    41         static CXcapHttpAuthManager* NewL( RHTTPSession& iHttpSession,
       
    42                                            CXcapHttpTransport& aTransportMain,
       
    43                                            const TXdmCredentials& aDigestCredentials );
       
    44         
       
    45         /**
       
    46         * Symbian OS default constructor.
       
    47         */   
       
    48         void SetAuthorized( TBool aAuthorized );
       
    49         
       
    50         /**
       
    51         * Symbian OS default constructor.
       
    52         */   
       
    53         TBool IsAuthorized() const;
       
    54         
       
    55         /**
       
    56         * Symbian OS default constructor.
       
    57         */                                      
       
    58         TBool ParseHeaderL( RHTTPTransaction& aTransaction, TInt aAuthType );
       
    59         
       
    60         /**
       
    61         * A global logging function for 8 bit data.
       
    62         * @param aCommand command to be handled
       
    63         */
       
    64         HBufC8* AuthorizationL( CXcapHttpRequest& aHttpRequest );
       
    65         
       
    66         /**
       
    67         * Symbian OS default constructor.
       
    68         */                                      
       
    69         TBool ConsumeAuthInfoParamL( TAuthInfoParam aName, const TDesC8& aValue );
       
    70         
       
    71         /**
       
    72         * Destructor.
       
    73         */      
       
    74         virtual ~CXcapHttpAuthManager();
       
    75                                
       
    76     private:
       
    77         
       
    78         /**
       
    79         * C++ default constructor.
       
    80         */      
       
    81         CXcapHttpAuthManager( RHTTPSession& iHttpSession,
       
    82                               CXcapHttpTransport& aTransportMain );
       
    83 
       
    84         /**
       
    85         * Symbian OS default constructor.
       
    86         * @param aMimeType MIME type of the messages
       
    87         */     
       
    88         void ConstructL( const TXdmCredentials& aDigestCredentials );
       
    89         
       
    90         /**
       
    91         * Symbian OS default constructor.
       
    92         * @param aMimeType MIME type of the messages
       
    93         */   
       
    94         void Unquote( TPtr8& aParamValue );
       
    95         
       
    96         /**
       
    97         * Symbian OS default constructor.
       
    98         * @param aMimeType MIME type of the messages
       
    99         */    
       
   100         void ConstructHA1L( TDes8& aResult );
       
   101         
       
   102         /**
       
   103         * Symbian OS default constructor.
       
   104         * @param aMimeType MIME type of the messages
       
   105         */    
       
   106         void ConstructHA2L( TDes8& aResult, CXcapHttpRequest& aHttpRequest );
       
   107         
       
   108         /**
       
   109         * Symbian OS default constructor.
       
   110         * @param aMimeType MIME type of the messages
       
   111         */   
       
   112         void Hash( const TDesC8& aMessage, TDes8& aHash );
       
   113         
       
   114         /**
       
   115         * Symbian OS default constructor.
       
   116         * @param aMimeType MIME type of the messages
       
   117         */   
       
   118         HBufC8* RequestDigestLC( CXcapHttpRequest& aHttpRequest );
       
   119         
       
   120         /**
       
   121         * Symbian OS default constructor.
       
   122         * @param aMimeType MIME type of the messages
       
   123         */ 
       
   124         void SetNextNonceL( const TDesC8& aNextnonce );
       
   125         
       
   126         /**
       
   127         * Symbian OS default constructor.
       
   128         * @param aMimeType MIME type of the messages
       
   129         */   
       
   130         void GenerateClientNonce();
       
   131         
       
   132         /**
       
   133         * Symbian OS default constructor.
       
   134         * @param aMimeType MIME type of the messages
       
   135         */     
       
   136         void ParseQopL( const TDesC8& aQopString );
       
   137 
       
   138     private: //Data
       
   139         
       
   140         TInt                                        iNonceCount;
       
   141         TBool                                       iAuthorized;
       
   142         TBool                                       iUnauthReceived;
       
   143         TBool                                       iNextnonce;
       
   144         CMD5*                                       iMD5;
       
   145 	    TInt64                                      iSeed;
       
   146 	    HBufC8*                                     iOpaque;
       
   147         HBufC8*                                     iServerNonce;
       
   148         HBufC8*                                     iRealm;
       
   149         HBufC8*                                     iDomain;
       
   150         HBufC8*                                     iAlgorithm;
       
   151         HBufC8*                                     iQopString;
       
   152         TXcapAuthQop                                iQop;
       
   153         RHTTPSession                                iHttpSession;
       
   154         CXcapHttpTransport&                         iTransportMain;
       
   155         TBuf8<KXcapHashLength>                      iClientNonce;
       
   156         TBuf8<KXdmMaxUserNameLength>                iUserName;
       
   157         TBuf8<KXdmMaxPasswordLength>                iPassword;
       
   158         RStringPool                                 iStringPool;
       
   159     };
       
   160 
       
   161 #endif
       
   162 
       
   163 // End of File