realtimenetprots/sipfw/SIP/SIPSec/DigestPlugin/inc/CSIPSecChallengeAKA.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2008-2009 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:
       
    15 * Name          : CSIPSecChallengeAKA.h
       
    16 * Part of       : SIPSec/DigestPlugin
       
    17 * Version       : SIP/6.0
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 #ifndef __CSIPSEC_CHALLENGEAKA_H__
       
    29 #define __CSIPSEC_CHALLENGEAKA_H__
       
    30 
       
    31 #include "CSIPSecChallengeMD5.h"
       
    32 
       
    33 
       
    34 /**
       
    35  * @brief Class representing AKA challenge received in 401/407 response
       
    36  * 
       
    37  * @class CSIPSecChallengeAKA CSIPSecChallengeAKA.h "CSIPSecChallengeAKA.h"
       
    38  *
       
    39  * This class extends MD5 challenge functionality
       
    40  * 
       
    41  * Class provides functions to process challenge and 
       
    42  * populate AKA specifig values to credentials 
       
    43  *
       
    44  */
       
    45 class CSIPSecChallengeAKA : public CSIPSecChallengeMD5
       
    46     {
       
    47 public: // Constructors and destructor
       
    48 
       
    49     /**
       
    50     * Constructs the object, and pushes it to cleanupstack.
       
    51     * @param aType The type of challenge
       
    52     * @param aAuthenticateHeader SIP authenticate header
       
    53     * @param aQop qop of the challenge
       
    54     * @return Return New CSIPSecChallengeAKA object
       
    55     */
       
    56     static CSIPSecChallengeAKA*
       
    57     	NewLC( CSIPSecDigest::TChallengeType aType,
       
    58     	       CSIPAuthenticateHeaderBase& aAuthenticateHeader,
       
    59     	       CSIPSecRequestData::TQop aQop );
       
    60 
       
    61     /**
       
    62     * Destructor
       
    63     */
       
    64     ~CSIPSecChallengeAKA();
       
    65 
       
    66 public: // From CSIPSecChallenge
       
    67 
       
    68     inline MSIPSecAlgorithm& Algorithm() 
       
    69         {
       
    70         return *this;
       
    71         }
       
    72 
       
    73 	void VerifyTypeL( CSIPSecUserRecord::TType aType ) const;
       
    74 
       
    75 	CSIPSecUserRecord* CreateUserRecordL( const TDesC8& aRealm,
       
    76 										  const MSIPSecUser& aUser,
       
    77 										  TRegistrationId aRegistrationId,
       
    78 									      TTransactionId aTransactionId,
       
    79 									      TUint aResponseCode ) const;
       
    80 
       
    81 public: // From MSIPSecAlgorithm
       
    82 
       
    83     RStringF AlgorithmName() const;    
       
    84 
       
    85     TBool ProcessResponseL( TSIPSecDigestCtxSetup& aContext,
       
    86     						TBool& aAskCredentials ) const;
       
    87 
       
    88 	void ProcessRequestL( TSIPSecDigestCtxProcess& aContext ) const;
       
    89 
       
    90 public: // New functions
       
    91 
       
    92     /**
       
    93     * The name of the supported algorithm
       
    94     * @return The name of the supported algorithm
       
    95     */
       
    96     static RStringF SupportedAlgorithm();
       
    97 
       
    98 
       
    99 protected: // Constructor, for internal use
       
   100 
       
   101     /*
       
   102      * Constructor
       
   103      * @param aType the type of challenge
       
   104      * @param aQop qop of the challenge
       
   105      */
       
   106     CSIPSecChallengeAKA( CSIPSecDigest::TChallengeType aType,
       
   107     					 CSIPSecRequestData::TQop aQop );
       
   108     };
       
   109 	
       
   110 #endif //end of __CSIPSEC_CHALLENGEAKA_H__
       
   111 
       
   112 // End of File